简体   繁体   中英

Swift Github Action CocoaPods build fails with "Framework not found Pods_iosapp"

I have a simple workflow definition to do an Xcode workspace build and test:

name: Swift iOS application
on: pull_request
jobs:
  test:
    name: Test
    runs-on: macOS-latest
    strategy:
        matrix:
          destination: ['platform=iOS Simulator,id=DEC5E859-67C9-4939-87A5-E749D824E541', 'platform=iOS Simulator,id=458AD46E-58ED-4016-875A-70965C6EC869']
    steps:
      - name: Checkout
        uses: actions/checkout@master
      - name: Build and Test
        run: |
          ls -al
          pod install --repo-update --clean-install
          ls -al
          echo "destination=${destination}"
          xcodebuild clean test -workspace iosapp.xcworkspace -scheme iosapp -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO
        env:
         destination: ${{ matrix.destination }}

The build command succeeds locally on my laptop but fails when Github Actions runs it. Here is a bit more error context:

Ditto /Users/runner/Library/Developer/Xcode/DerivedData/iosapp-emrlpxjejtcsbjdrjgmowfxebepf/Build/Products/Debug-iphonesimulator/iosapp.swiftmodule/i386-apple-ios-simulator.swiftdoc /Users/runner/Library/Developer/Xcode/DerivedData/iosapp-emrlpxjejtcsbjdrjgmowfxebepf/Build/Intermediates.noindex/iosapp.build/Debug-iphonesimulator/iosapp.build/Objects-normal/i386/iosapp.swiftdoc (in target 'iosapp' from project 'iosapp')
    cd /Users/runner/runners/2.165.2/work/ios-app/ios-app
    /usr/bin/ditto -rsrc /Users/runner/Library/Developer/Xcode/DerivedData/iosapp-emrlpxjejtcsbjdrjgmowfxebepf/Build/Intermediates.noindex/iosapp.build/Debug-iphonesimulator/iosapp.build/Objects-normal/i386/iosapp.swiftdoc /Users/runner/Library/Developer/Xcode/DerivedData/iosapp-emrlpxjejtcsbjdrjgmowfxebepf/Build/Products/Debug-iphonesimulator/iosapp.swiftmodule/i386-apple-ios-simulator.swiftdoc

Testing failed:

Test session results, code coverage, and logs:
    Command MergeSwiftModule failed with a nonzero exit code
    Framework not found Pods_iosapp
    Testing cancelled because the build failed.

** TEST FAILED **

And finally here is my Podfile, nothing fancy:

# Uncomment this line to define a global platform for your project
platform :ios, '12.0'

target 'iosapp' do
    pod 'BMSCore', '~> 2.6.0'
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for iosapp

  target 'iosappTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'iosappUITests' do
  inherit! :search_paths
  # Pods for testing
end

Does anyone understand why it is failing with this error?

您需要将参数写在双引号下,例如:

xcodebuild clean test -workspace "iosapp.xcworkspace"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM