Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

ios - The following build commands failed: PhaseScriptExecution Run Script in fastlane

when I build the ios project using this command in Flutter in github actions(by the way, using the same command in my local macOS catalina 10.15.7 and xcode 12.3 works fine):

./ios && bundle exec fastlane beta

shows this error:

** ARCHIVE FAILED **


The following build commands failed:
    PhaseScriptExecution Run Script /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gzzbtgmsqethlzedjqlbspydxjjv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh
(1 failure)
[05:17:23]: Exit status: 65
[05:17:23]: 
[05:17:23]: Maybe the error shown is caused by using the wrong version of Xcode
[05:17:23]: Found multiple versions of Xcode in '/Applications/'
[05:17:23]: Make sure you selected the right version for your project
[05:17:23]: This build process was executed using '/Applications/Xcode_12.3.app'
[05:17:23]: If you want to update your Xcode path, either
[05:17:23]: 
[05:17:23]: - Specify the Xcode version in your Fastfile
[05:17:23]: ? xcversion(version: "8.1") # Selects Xcode 8.1.0
[05:17:23]: 
[05:17:23]: - Specify an absolute path to your Xcode installation in your Fastfile
[05:17:23]: ? xcode_select "/Applications/Xcode8.app"
[05:17:23]: 
[05:17:23]: - Manually update the path using
[05:17:23]: ? sudo xcode-select -s /Applications/Xcode.app
[05:17:23]: 

this is the fastlane, in this script, I specify the xcode version 12.3 :

    xcversion(version: "12.3")
    xcode_select("/Applications/Xcode_12.3.app")
    if is_ci
      create_keychain(
        name: ENV['MATCH_KEYCHAIN_NAME'],
        password: ENV["MATCH_KEYCHAIN_PASSWORD"],
        default_keychain: true,
        unlock: true,
        timeout: 3600,
        lock_when_sleeps: false
      )
    end

where is going wrong and what should I do to fix it? I have tried to execute the commad in github actions, this is my config:

jobs:
  build:
    runs-on: macos-latest
    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_12.3.app/Contents/Developer'
    - name: Bundle install
      run: cd ./ios && 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 && bundle exec fastlane beta
      

I tried to install new version(1.10.0) of cocopods(the same verion of my local Macbook Pro):

  - name: Bundle install
      run: cd ./ios && gem install cocoapods -v 1.10.0 && bundle install && bundle update fastlane
    

and tried to tweak the build type of xcode:

enter image description here

still not work.

question from:https://stackoverflow.com/questions/65839800/the-following-build-commands-failed-phasescriptexecution-run-script-in-fastlane

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

1 Answer

0 votes
by (71.8m points)

Your build log shows the following error:

[05:32:01]: ? ../../../hostedtoolcache/flutter/1.22.5-stable/x64/packages/flutter/lib/src/widgets/scroll_view.dart:588:9: Context: Found this candidate, but the arguments don't match.
[05:32:01]: ?   const CustomScrollView({
[05:32:01]: ?         ^^^^^^^^^^^^^^^^
[05:32:01]: ? Command PhaseScriptExecution failed with a nonzero exit code
[05:32:01]: 

Could you check this? It might be possible that the error is not due to any xcode version.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...