简体   繁体   中英

Xcode 9: xcodebuild -exportArchive Error Reading File: info.plist

I have a project with multiple build configurations and build scripts that was recently migrated from Xcode 8 to Xcode9. It builds and runs fine to both simulator and device from Xcode, as well as archiving correctly. However, when I try to build or archive from the command line, it succeeds but the app crashes upon opening (on simulator) or gives an error message (when opening on device).

To archive from Jenkins Continuous Integration, I'm running

'xcodebuild -exportArchive -archivePath myApp.xcarchive -exportOptionsPlist ./build/exportArchive.plist -exportPath myApp.ipa'

and it creates an ipa, but when I try to open the ipa, it gives me this error:

"Unable To Install 'Error Reading File: info.plist' Please try again later."

and the app name itself is "ErrorReadingFile:info.plist"

When I open up the .ipa file that was exported it has no dSYMs or info.plist, only a Products folder with .app inside, and the .app file is entirely empty except for some iPad icon images (this should be a universal app).


Also, when I run the commands to build and deploy for simulator:

xcodebuild -sdk iphonesimulator -configuration Debug -project myApp
xcrun simctl install <whatever device id> myApp.app
xcrun simctl launch <whatever device id> com.whatever.myApp

It successfully installs the app and then crashes immediately after launch with no error codes. This is what shows up in the report after the simulator crash:

Crashed Thread: 0 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: DYLD, [0x9]

How do I get this to build/run/archive properly from the command line??

I can suggest making 'archive', and then 'export archive' directly from Xcode, just to figure out is it a problem with the build, or with scripts.

You said you have multiple configurations. Maybe you are building the wrong scheme?

Can you provide your build commands?

Also, xcode 9 has new requirements to exportArchive.plist. And if you will do export archive directly from Xcode, it will save plist, which was used to export, with the export result. And you can use it later in your build scripts.

I use fastlane for build apps on CI. It's easier than make all stuff manually. I use follow lane to build a develop archive:

lane :development_archive do
    gym(
        output_directory: ENV['ARTIFACT_OUTPUT_DIRECTORY'],
        output_name: ENV['IPA_ARCHIVE_NAME'],
        scheme: ENV['SCHEME'],
        include_bitcode: false,
        configuration: 'Debug',
        export_method: "development",
    )
end

And in the command line I just type fastlane development_archive to get IPA archive. Maybe, you should add additional steps to the Fastlane script, like install pods. Read documentation, Fastlane is a greate tools for CI.

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