fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.51k stars 5.7k forks source link

gradlew: cannot execute binary file #19764

Closed lyqiai closed 2 years ago

lyqiai commented 2 years ago

New Issue Checklist

Issue Description

run bundle exec fastlane xxx got some errors: /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': [!] Exit status of command '/Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew clean --stacktrace -p .' was 126 instead of 0. (FastlaneCore::Interface::FastlaneShellError) /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: cannot execute binary file

Command executed

+------+--------------------------+-------------+ | fastlane summary | +------+--------------------------+-------------+ | Step | Action | Time (in s) | +------+--------------------------+-------------+ | 1 | default_platform | 0 | | 2 | android_get_version_code | 0 | | 3 | android_set_version_code | 0 | | 💥 | clean --stacktrace | 0 | +------+--------------------------+-------------+ gradle(task: "clean --stacktrace")

Complete output when running fastlane, including the stack trace and command used
 Running with gitlab-runner 14.4.0 (4b9e985a)
  on Mobile Mac Runner F_kUF7jA
section_start:1641267512:prepare_executor
Preparing the "shell" executor
Using Shell executor...
section_end:1641267512:prepare_executor
section_start:1641267512:prepare_script
Preparing environment
Running on mobiledeMac-mini.local...
section_end:1641267512:prepare_script
section_start:1641267512:get_sources
Getting source from Git repository
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/.git/
Checking out 6b9d8978 as master...
Updating/initializing submodules recursively with git depth set to 50...
section_end:1641267513:get_sources
section_start:1641267513:step_script
Executing "step_script" stage of the job script
$ export VERSION_CODE=$CI_PIPELINE_IID && echo $VERSION_CODE
7
$ export VERSION_SHA=`echo ${CI_COMMIT_SHA:0:8}` && echo $VERSION_SHA
6b9d8978
$ chmod +x ./gradlew
$ bundle exec fastlane build_prod
+------------------------------------+---------+--------------------------------------------------------------------------------------------------------+
|                                                                     Used plugins                                                                      |
+------------------------------------+---------+--------------------------------------------------------------------------------------------------------+
| Plugin                             | Version | Action                                                                                                 |
+------------------------------------+---------+--------------------------------------------------------------------------------------------------------+
| fastlane-plugin-ding_talk_msg_push | 0.1.2   | ding_talk_msg_md_push, ding_talk_msg_push                                                              |
| fastlane-plugin-versioning_android | 0.1.0   | android_get_version_name, android_set_version_code, android_set_version_name, android_get_version_code |
| fastlane-plugin-zealot             | 0.8.0   | zealot_version_check, zealot_sync_devices, zealot_debug_file, zealot                                   |
+------------------------------------+---------+--------------------------------------------------------------------------------------------------------+

[11:38:35]: ------------------------------
[11:38:35]: --- Step: default_platform ---
[11:38:35]: ------------------------------
[11:38:35]: Driving the lane 'android build_prod' 🚀
[11:38:35]: --------------------------------------
[11:38:35]: --- Step: android_get_version_code ---
[11:38:35]: --------------------------------------
[11:38:35]: 👍  Current Android Version Code is: 10
[11:38:35]: --------------------------------------
[11:38:35]: --- Step: android_set_version_code ---
[11:38:35]: --------------------------------------
[11:38:35]: ☝️  Android Version Code has been set to: 11
[11:38:35]: --------------------------------
[11:38:35]: --- Step: clean --stacktrace ---
[11:38:35]: --------------------------------
[11:38:35]: $ /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew clean --stacktrace -p .
[11:38:35]: ▸ /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: cannot execute binary file
+--------------------------+--------------------+
|                 Lane Context                  |
+--------------------------+--------------------+
| DEFAULT_PLATFORM         | android            |
| PLATFORM_NAME            | android            |
| LANE_NAME                | android build_prod |
| ANDROID_VERSION_CODE     | 10                 |
| ANDROID_NEW_VERSION_CODE | 11                 |
+--------------------------+--------------------+
[11:38:35]: Exit status of command '/Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew clean --stacktrace -p .' was 126 instead of 0.
/Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: cannot execute binary file


+------+--------------------------+-------------+
|               fastlane summary                |
+------+--------------------------+-------------+
| Step | Action                   | Time (in s) |
+------+--------------------------+-------------+
| 1    | default_platform         | 0           |
| 2    | android_get_version_code | 0           |
| 3    | android_set_version_code | 0           |
| 💥   | clean --stacktrace       | 0           |
+------+--------------------------+-------------+

[11:38:35]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

bundler: failed to load command: fastlane (/usr/local/bin/fastlane)
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': [!] Exit status of command '/Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew clean --stacktrace -p .' was 126 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
/Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: /Users/mobile/builds/F_kUF7jA/0/mobile/brazil-express-internal-android/gradlew: cannot execute binary file

    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `sh'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/helper/gradle_helper.rb:32:in `trigger'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/actions/gradle.rb:60:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
    from Fastfile:58:in `block (2 levels) in parsing_binding'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/lane.rb:33:in `call'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/commands_generator.rb:109:in `block (2 levels) in run'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:117:in `run!'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/commands_generator.rb:353:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.199.0/bin/fastlane:23:in `'
    from /usr/local/bin/fastlane:23:in `load'
    from /usr/local/bin/fastlane:23:in `'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:in `load'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:in `kernel_load'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:28:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:494:in `exec'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:30:in `dispatch'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:24:in `start'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:49:in `block in '
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:37:in `'
    from /usr/local/bin/bundle:23:in `load'
    from /usr/local/bin/bundle:23:in `
' section_end:1641267516:step_script ERROR: Job failed: exit status 1 

Environment

 
� fastlane environment � ### Stack | Key | Value | | --------------------------- | ---------------------------- | | OS | UNKNOWN | | Ruby | 3.0.3 | | Bundler? | false | | Git | git version 2.30.2.windows.1 | | Installation Source | F:/Ruby30-x64/bin/fastlane | | Host | Unknown () | | Ruby Lib Dir | F:/Ruby30-x64/lib | | OpenSSL Version | OpenSSL 1.1.1l 24 Aug 2021 | | Is contained | false | | Is homebrew | false | | Is installed via Fabric.app | false |
fastlane-bot commented 2 years ago

It seems like you have not included the output of fastlane env To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env :+1: