[ 
https://issues.apache.org/jira/browse/CB-10201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15088158#comment-15088158
 ] 

Billy Catherall commented on CB-10201:
--------------------------------------

So during the build process the gradlew script is copied from the Android SDK 
into the Cordova Android application. The gradlew file is simply a script and 
needs execute permissions to run correctly. Most of the time when installing 
the Android SDK the gradlew file is given execute permission, so when Cordova 
copies it over everything works just fine.

Under some circumstances the Android SDK doesn't set the permissions on some of 
the scripts correctly and they will end up not having execute permissions. When 
this happens "cordova build android" will fail with a permissions error when it 
tries to run gradlew and part of the android build. 

I'm not sure of the exact circumstances that causes the Android SDK to set 
incorrect permissions on some of it's scripts, but I have a suspicion that it's 
due to some tools that are being used by corporate security to "secure" OSx 
systems. 

A better fix would be to find out why the gradlew script in the SDK is not 
getting the correct permissions, but since Cordova is copying this script into 
it's build, it might as well verify that it has the permissions to actually run 
it.



> Cordova-android not setting execute permissions on gradlew
> ----------------------------------------------------------
>
>                 Key: CB-10201
>                 URL: https://issues.apache.org/jira/browse/CB-10201
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 5.0.0
>         Environment: OSX
>            Reporter: Billy Catherall
>            Priority: Minor
>              Labels: newbie, triaged
>
> When cordova build copies the gradlew script into the platform directory it 
> doesn't set the +x flag so the script throws a permissions error during build.
> ERROR building one of the platforms: Error: /xxx/platforms/android/gradlew: 
> Command failed with exit code EACCES
> This can be fixed in bin/templates/cordova/lib/builders/GradleBuilder.js bu 
> adding 'shell.chmod('u+x', path.join(self.root, 'gradlew'));' just after 
> 'shell.cp(path.join(wrapperDir, 'gradlew'), self.root);' around line 150.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to