升级到xcode8后,我的项目将不再运行在模拟器上(runs on a device)
错误:
/Users/johnsmith/Library/Developer/Xcode/DerivedData/JT-fnslglvifmonzwhlgrchcqujqiwt/Build/Products/Debug-iphonesimulator/
Assets.bundle: Is a directory
Command /usr/bin/codesign failed with exit code 1
我已经删除了整个 deriveddata 文件夹并多次清理项目但没有成功。请问有什么解决办法吗?
最佳答案
如果您使用 CocoaPods(尤其是旧版本),您会注意到 pods 项目文件中的所有资源包目标都没有 info.plist。
使用 CocoaPods 通用 Info.plist 设置它们,它就会运行。
然而,这不是永久的解决方案。它将在下一个 pod install
重置
https://forums.developer.apple.com/thread/66538
编辑:
如果你的项目中还没有一个通用的 plist 文件
创建一个新文件 Info.plist
在 Pod 中 Target Support Files/Pods-<App Name>/
并粘贴此内容
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
编辑 2:
修正了上面的值。像以前那样上传到 App Store 时,Apple 不会接受它。
它不应该有 CFBundleExecutable
和 CFBundlePackageType
应设置为 BNDL
关于ios - 项目不会在 xcode 8 中的模拟器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40481800/