简体   繁体   English

Xcode 9:xcodebuild -exportArchive错误读取文件:info.plist

[英]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. 我有一个具有多个构建配置和构建脚本的项目,该项目最近从Xcode 8迁移到Xcode9。 It builds and runs fine to both simulator and device from Xcode, as well as archiving correctly. 它可以从Xcode构建并在模拟器和设备上正常运行,并且可以正确存档。 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 要从Jenkins Continuous Integration存档,我正在运行

'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: 并创建了一个ipa,但是当我尝试打开ipa时,它给了我这个错误:

"Unable To Install 'Error Reading File: info.plist' Please try again later." “无法安装'错误读取文件:info.plist',请稍后再试。”

and the app name itself is "ErrorReadingFile:info.plist" 并且应用程序名称本身为“ 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). 当我打开导出的.ipa文件时,它没有dSYM或info.plist,只有一个包含.app的Products文件夹,并且.app文件完全为空,除了一些iPad图标图像(这应该是通用应用程序) )。


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] 损坏的线程:0异常类型:EXC_CRASH(SIGABRT)异常代码:0x0000000000000000,0x0000000000000000异常注释:EXC_CORPSE_NOTIFY终止原因: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. 我可以建议直接从Xcode进行“归档”,然后进行“导出存档”,只是为了弄清楚构建或脚本是否存在问题。

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. 另外,xcode 9对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. 而且,如果您要直接从Xcode导出存档,它将保存用于导出的plist及其导出结果。 And you can use it later in your build scripts. 您稍后可以在构建脚本中使用它。

I use fastlane for build apps on CI. 我使用fastlane在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. 在命令行中,我只需键入fastlane development_archive即可获取IPA存档。 Maybe, you should add additional steps to the Fastlane script, like install pods. 也许,您应该在Fastlane脚本中添加其他步骤,例如安装Pod。 Read documentation, Fastlane is a greate tools for CI. 阅读文档,Fastlane是CI的绝佳工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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