androidcapacitorionic-appflow

AppFlow Capacitor Build Error: PermissionDenied gradlew


My android build fails in appflow. I simply followed the instructions and have no idea how to solve this.

Here is the last bit of the build log:

[07:25:07]: Building android...
+----------------------------+-----------------------+
|                    Lane Context                    |
+----------------------------+-----------------------+
| DEFAULT_PLATFORM           | ios                   |
| PLATFORM_NAME              | android               |
| LANE_NAME                  | android package_build |
| PROJECT_WEB_DIR            | www                   |
| DOWNLOAD_CREDENTIAL_EXISTS | false                 |
| GRADLE_BUILD_TYPE          | Debug                 |
+----------------------------+-----------------------+
[07:25:07]: Permission denied - /builds/project-0/android/gradlew

+------+-------------------------+-------------+
|               fastlane summary               |
+------+-------------------------+-------------+
| Step | Action                  | Time (in s) |
+------+-------------------------+-------------+
| 1    | default_platform        | 0           |
| 2    | build_summary           | 1           |
| 3    | add_git_credentials     | 0           |
| 4    | detect_native_type      | 0           |
| 5    | get_web_dir             | 0           |
| 6    | modify_cap_web_config   | 0           |
| 7    | download_credential     | 0           |
| 8    | build_pro_app           | 60          |
| 9    | cap_sync                | 1           |
| 10   | cap_custom_deploy       | 0           |
| 💥   | build_android_capacitor | 0           |
+------+-------------------------+-------------+

[07:25:07]: fastlane finished with errors
/usr/local/bin/fastlane: [!] Permission denied - /builds/project-0/android/gradlew (Errno::EACCES)
Running after script...
$ run "clean-up"
ERROR: Job failed: command terminated with exit code 1

Any help is appreciated!


Solution

  • This can sometimes happen when the platform is created in a Windows system. You need to add execute permission to gradlew. If necessary you can set linux style permission on Windows using git.

    https://ionic.zendesk.com/hc/en-us/articles/360000160067-Adding-execute-permissions-using-git