Since NS7 update, some plugins fail building with "Error: spawn ./gradlew EACCES"
@rigor789 arbeitet bereits daran.
Seit 04.9.2020.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
I personally haven't tested it on Windows, so there might not be any problems on that platform because the build scripts are handled separately.
Since the update to NS7 a few days ago, there have been multiple people on the NSCommunity Slack reporting this. I personally have encountered the problem in relation to nativescript-socket.io, but it's not specific to it, as it actually boils down to an issue in the CLI.
The problem is two-fold: first, the EACCES error is caused by the gradlew file not being being marked as executable. Once this is fixed, errors relating to the carriage return character start popping up. The issue now is that the gradlew file uses windows style newline (\r\n) instead of *nix style newline (\n). I've implemented a quick and dirty fix, but this only solves the symptoms, it doesn't solve the problem at the root cause as I'm not familiar enough with NS to know which part of the tooling generates the gradlew file when building plugins.
The temporary fix involves editing a file in the NS CLI:
- in the global node_modules folder (unless NS is locally installed under the project's devDependencies), find
nativescript/lib/services/android-plugin-build-service.js - anywhere at the top of the file (maybe between lines 19-24 for consistency's sake) add
const fs = require("fs"); - at line 413 (formerly 412 before the above addition) add:
if (!this.$hostInfo.isWindows) {
const gradleFile = path.join(pluginBuildSettings.pluginDir, gradlew);
let content = fs.readFileSync(gradleFile, {encoding:'utf8', flag:'r'});
content = content.replace(/\r/g, '');
fs.writeFileSync(gradleFile, content);
fs.chmodSync(gradleFile, 0o755, (err) => {
if (err) {
console.log("Error changing setting gradlew as executable");
throw err;
}
});
}
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 204
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 8
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus NativeScript/nativescript-cli
-
in-progress
NativeScript/nativescript-cli#6140 · 2 Kommentare · 1 zugewiesene Person ·
-
NativeScript/nativescript-cli#6090 · 1 zugewiesene Person ·
-
in progress
NativeScript/nativescript-cli#6015 · 1 Reaktion · 1 zugewiesene Person ·
-
question
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
NativeScript/nativescript-cli#5992 · 5 Kommentare ·
-
feature-pending-triage
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
NativeScript/nativescript-cli#5975 ·
Alle Issues in NativeScript/nativescript-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Seeed-Studio/wiki-documents#5655 · 2 Kommentare ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
capricorn86/happy-dom#2435 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Edit: CW+ Offenchannels:edit check:passed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
01 type: bug 30 needs: triage 99 tag: UX Accessibility
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100