[AppFlow Capacitor] Permission denied - /builds/***/ionic-capacitor/android/gradlew

I created a new tabs app with capacitor with only scaffold-ed code. In the AppFlow the package for android succeeded.

I then added android platform and make sure it works in both emulator and my android mobile phone in my local computer. In the AppFlow the package for android failed.

±---------------------------±-----------------------------------------------------+
| Lane Context |
±---------------------------±-----------------------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | android |
| LANE_NAME | android package_build |
| PROJECT_WEB_DIR | www |
| DOWNLOAD_CREDENTIAL_EXISTS | true |
| DOWNLOAD_CREDENTIAL_PATH | /builds/stephenzeng/ionic-capacitor/android.keystore |
| DOWNLOAD_CREDENTIAL_ALIAS | ionic-capacitor |
| GRADLE_BUILD_TYPE | Release |
±---------------------------±-----------------------------------------------------+
[05:48:10]: Permission denied - /builds/***/ionic-capacitor/android/gradlew

Build number is 6646260

Can anyone help please?

Also got this, exact same error, build number 6752211. It was on a new project where I followed the “get started” guide for android + capacitor.

Have you tried to update gradle via Android studio? Once initial loading of files are configured, you’ll see a notification on bottom right hand corner stating to upgrade the gradle verison in the project. Also It says Permission denied in which you don’t have access to build signed APKs.

I did the same and have the same issue. Did you resolved it?

It may be necessary to add execute permissions to custom build and hook scripts included in a project repo. This most frequently presents with the error Error: spawn EACCES during Deploy or Package builds.

Adding execute permissions is possible on any OS with git installed using the following command.

git update-index --chmod=+x

This command modifies the repo directly. Be sure to run this after running git add and before git commit.

example:

git add . git update-index --chmod=+x git commit -m ‘adding execute permissions’ git push ionic master

Hi everyone, as a couple of you mentioned, it’s a permissions issue. When the Android platform is added (via Capacitor) on a Windows system, this file can be missing the necessary Linux style execute permissions.

The Appflow team just shipped a fix to handle this inside of Appflow, so native Android builds should work fine as-is now. However, you still might want to tweak the permissions of the Gradle file. Details here.

1 Like