Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

flutter - /bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory in github actions

when I build my project in github actions, shows this error:

/bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory

in my local machine, it could build success. the is the log output:

+---------------+------------------------------+
|              Build environment               |
+---------------+------------------------------+
| xcode_path    | /Applications/Xcode_11.7.app |
| gym_version   | 2.172.0                      |
| export_method | ad-hoc                       |
| sdk           | iPhoneOS13.7.sdk             |
+---------------+------------------------------+

[16:09:59]: ?     export YACC=yacc
[16:09:59]: ?     export arch=arm64
[16:09:59]: ?     export variant=normal
[16:09:59]: ?     /bin/sh -c /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gzzbtgmsqethlzedjqlbspydxjjv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh
[16:09:59]: ? /bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
[16:09:59]: 
[16:09:59]: ??  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[16:09:59]: ??  For the complete and more detailed error log, check the full log at:
[16:09:59]: ??  /Users/runner/Library/Logs/gym/Runner-Runner.log
[16:09:59]: 
[16:09:59]: Looks like fastlane ran into a build/archive error with your project
[16:09:59]: It's hard to tell what's causing the error, so we wrote some guides on how
[16:09:59]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[16:09:59]: Before submitting an issue on GitHub, please follow the guide above and make
[16:09:59]: sure your project is set up correctly.
[16:09:59]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[16:09:59]: the full commands printed out in yellow in the above log.
[16:09:59]: Make sure to inspect the output above, as usually you'll find more error information there

and this is my github action script:

name: Cruise-CI

on:
  push:
    branches: [ main ]

jobs:
  build:
    runs-on: macos-10.15
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-java@v1
      with:
        java-version: '12.x'
    - uses: subosito/flutter-action@v1
      with:
        flutter-version: '1.22.5'
    - name: Select Xcode version
      run: sudo xcode-select -s '/Applications/Xcode_11.7.app/Contents/Developer'
    - name: Bundle install
      run: cd ./ios && flutter clean  && gem install cocoapods -v 1.10.0 && bundle install && bundle update fastlane
    - name: Install tools
      run: |
       flutter precache
       flutter pub get
       cd ./ios && pod repo update && pod install
    #- run: flutter pub get
    #- run: flutter build apk
    #- run: flutter build ios --release --no-codesign
    - name: Setup SSH Keys and known_hosts for fastlane match
      run: |
        SSH_PATH="$HOME/.ssh"
        mkdir -p "$SSH_PATH"
        touch "$SSH_PATH/known_hosts"
        echo "$PRIVATE_KEY" > "$SSH_PATH/id_rsa"
        chmod 700 "$SSH_PATH"
        ssh-keyscan github.com >> ~/.ssh/known_hosts
        chmod 600 "$SSH_PATH/known_hosts"
        chmod 600 "$SSH_PATH/id_rsa"
        eval $(ssh-agent)
        ssh-add "$SSH_PATH/id_rsa"
      env:
        PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
    - name: Deploy to TestFlight/PGY
      run: |
        cd ./ios && security unlock-keychain ${HOME}/Library/Keychains/login.keychain && flutter clean && bundle exec fastlane beta
      env:
        APPLE_ID: ${{ secrets.APPLE_ID }}
        GIT_URL: ${{ secrets.GIT_URL }}
        PGY_USER_KEY: ${{ secrets.PGY_USER_KEY }}
        PGY_API_KEY: ${{ secrets.PGY_API_KEY }}
        TEAM_ID: ${{ secrets.TEAM_ID }}
        ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
        FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
        FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
        FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
        FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
        MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
        MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
        MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
        DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS: ${{ secrets.DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS }}

what should I do to fix it? I am searching from internet and tell me to set flutter_root,but I did not know how to set the variable in github action, seem it management by system and dit not need to set.

question from:https://stackoverflow.com/questions/65867178/bin-sh-packages-flutter-tools-bin-xcode-backend-sh-no-such-file-or-directory

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...