Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS问题 #44

Closed
zhouzhongyuan opened this issue Apr 7, 2017 · 2 comments
Closed

iOS问题 #44

zhouzhongyuan opened this issue Apr 7, 2017 · 2 comments
Labels

Comments

@zhouzhongyuan
Copy link
Owner

zhouzhongyuan commented Apr 7, 2017

1. No applicable devices found.错误

错误截图

2017-04-07 3 56 15

错误信息

2017-04-07 14:31:39.065 xcodebuild[46423:25933551] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fef83cd5260>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.

Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}

** EXPORT FAILED **

解决路径

查看详细的错误信息

文件/private/var/folders/hc/jcspn_q93830mlr8dz0jx1pr0000gn/T/yesapp_2017-04-07_14-31-31.445.xcdistributionlogs/IDEDistribution.standard.log中可以找到

    yesapp.app/yesapp arm64 ->
error: Info.plist of “yesapp.app/YesResource.bundle/Contents” specifies a non-existent file for the CFBundleExecutable key

根据详细的错误信息,可以知道是因为yesapp.app/YesResource.bundle/Contents/Info.plist的key为CFBundleExecutable的value不对。

修改yesapp.app/YesResource.bundle/Contents/Info.plist

直接在Xcode中打开此文件,发现根本找不到"CFBundleExecutable"这一行:
2017-04-07 4 07 08

搜索一下就能找到了:
2017-04-07 4 07 43
删除之。

也可以使用cli修改此文件,vi libs/YesAPI.framework/YesResource.bundle/Contents/Info.plist.
2017-04-07 4 14 37

问题来源

本来想要使用cli进行企业打包。
执行下面的命令

 cp /Users/bokeadmin/project/ios-pack/routes/pack/exportOptions.plist ./
xcodebuild -project  yesapp.xcodeproj -scheme yesapp -sdk iphoneos archive -archivePath $PWD/build/yesapp.xcarchive -configuration Release
xcodebuild -exportArchive -archivePath $PWD/build/yesapp.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build
@zhouzhongyuan
Copy link
Owner Author

zhouzhongyuan commented Apr 8, 2017

2. xcodebuild打包提示 this project contains no schemes

错误现象

  • 使用
xcodebuild -project  yesapp.xcodeproj -scheme yesapp -sdk iphoneos archive -archivePath $PWD/build/yesapp.xcarchive -configuration Release

命令打包时,提示没有schemes。

  • 但是如果使用XCode进行打包,就可以正常打包。
  • 使用XCode打开项目,然后执行上述命令,也可以正常打包。

解决办法

Based on the Bryan Mussial answer

The root cause is that the default behavior of Schemes is to keep schemes 'private' until they are specifically marked as shared. In the case of a command-line initiated build, the Xcode UI never runs and the xcoderun tool doesn't have its own cache of Schemes to work with.
To your schema be visible for command-line build you must mark it as a shared scheme.

  • Choose Scheme > Manage Schemes (from the Product Menu).
  • Ensure the 'Shared' box is checked for that scheme
  • A new .xcscheme file has been created in your project at
    WorkspaceName.xcworkspace/xcshareddata/xcschemes.
  • Commit this file to your repository

2017-04-08 11 30 58
2017-04-08 11 31 13

参考

@zhouzhongyuan
Copy link
Owner Author

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "WechatQRPayViewController" nib but the view outlet was not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant