You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Android builds when gradle args and project dir have spaces (#2648)
In case you try building application, it will fail in case the following conditions are applied:
* build on Windows
* build for Android
* build in release
* path to project dir has spaces
* path to certificate (keystore) has spaces OR the certificate(keystore) name itself has spaces OR the password has spaces
The problem is in Node.js's `child_process` when `spawn` is used - on Windows it has issues when both the command (in our case this is the FULL PATH to gradlew.bat executable in platforms dir of the project) and ANY of the arguments passed to `child_process's spawn` have spaces.
As we are also setting the current working directory of the spawned process to be the path to `<project dir>/platforms/android`, change the `command` passed to `spawn` to be just `gradlew`. This way we'll never have spaces in the command and we'll not hit this issue.
@@ -253,18 +254,15 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
253
254
buildOptions.unshift("--stacktrace");
254
255
buildOptions.unshift("--debug");
255
256
}
257
+
256
258
buildOptions.unshift("buildapk");
257
-
letgradleBin=path.join(projectRoot,"gradlew");
258
-
if(this.$hostInfo.isWindows){
259
-
gradleBin+=".bat";// cmd command line parsing rules are weird. Avoid issues with quotes. See https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/lib/builders/GradleBuilder.js for another approach
0 commit comments