xcode iOS 9 中的新警告:“所有位码都将被删除”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30848208/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
New warnings in iOS 9: "all bitcode will be dropped"
提问by C.Farrugia
I have this new warning about the Google Framework in my app:
我的应用中有关于 Google 框架的新警告:
(null): URGENT: all bitcode will be dropped because '/Users/myname/Library/Mobile Documents/com~apple~CloudDocs/foldername/appname/GoogleMobileAds.framework/GoogleMobileAds(GADSlot+AdEvents.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
(null): 紧急:所有位码都将被删除,因为 '/Users/myname/Library/Mobile Documents/com~apple~CloudDocs/foldername/appname/GoogleMobileAds.framework/GoogleMobileAds(GADSlot+AdEvents.o)' 是在没有位码的情况下构建的. 您必须在启用位码的情况下重建它(Xcode 设置 ENABLE_BITCODE),从供应商处获取更新的库,或为此目标禁用位码。注意:这将是未来的错误。
Xcode 7 is giving me around 204 warnings about this same concept, and I could not get around with this. Also I have a problem accessing the network from my app. This is the error from the Debugging Area:
Xcode 7 给了我大约 204 个关于同一概念的警告,我无法解决这个问题。此外,我在从我的应用程序访问网络时遇到问题。这是来自调试区的错误:
-canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme kindle"
-canOpenURL:URL 失败:“kindle://home” - 错误:“此应用程序不允许查询方案 kindle”
All of these problems were not present in iOS 8.
所有这些问题在 iOS 8 中都不存在。
回答by Zia
Your library was compiled without bitcode, but the bitcode option is enabled in your project settings. Say NO
to Enable Bitcode
in your target Build Settings and the Library Build Settings to remove the warnings.
您的库是在没有 bitcode 的情况下编译的,但在您的项目设置中启用了 bitcode 选项。说NO
来Enable Bitcode
在你的目标生成设置和库生成设置删除警告。
For those wondering if enabling bitcode is required:
对于那些想知道是否需要启用位码的人:
For iOS apps, bitcode is the default, but optional. For watchOS and tvOS apps, bitcode is required. If you provide bitcode, all apps and frameworks in the app bundle (all targets in the project) need to include bitcode.
对于 iOS 应用程序,位码是默认的,但可选的。对于 watchOS 和 tvOS 应用程序,位码是必需的。如果您提供 bitcode,则应用程序包中的所有应用程序和框架(项目中的所有目标)都需要包含 bitcode。
回答by ElonChan
After Xcode 7, the bitcode option will be enabled by default. If your library was compiled without bitcode, but the bitcode option is enabled in your project settings, you can:
在 Xcode 7 之后,bitcode 选项将默认启用。如果您的库是在没有 bitcode 的情况下编译的,但在您的项目设置中启用了 bitcode 选项,您可以:
- Update your library with bit code,
- Say NO to Enable Bitcodein your target Build Settings
- 使用位代码更新您的库,
- 对在目标构建设置中启用 Bitcode说“不”
And the Library Build Settings to remove the warnings.
以及删除警告的库构建设置。
For more information, go to documentation of bitcode in developer library.
有关更多信息,请转到开发人员库中的 bitcode 文档。
And WWDC 2015 Session 102: "Platforms State of the Union"
以及 WWDC 2015 Session 102:“平台国情咨文”
回答by Javier Calatrava Llavería
In my case for avoiding that problem:
在我避免这个问题的情况下:
Be sure that you are dealing with Xcode 7, NOT lower versions. In lower version this flag does not exist.
Setup: Project>Build Settings>All>Build Options>Enable Bitcode = NO
确保您使用的是Xcode 7,而不是更低版本。在较低版本中,此标志不存在。
设置:Project>Build Settings>All>Build Options>Enable Bitcode = NO
回答by Saren Inden
Method canOpenUrl
is in iOS 9 (due to privacy) changed and is not free to use any more. Your banner provider checks for installed apps so that they do not show banners for an app that is already installed.
方法canOpenUrl
在 iOS 9 中(由于隐私)改变了,不能再免费使用了。您的横幅提供商会检查已安装的应用程序,以便它们不会为已安装的应用程序显示横幅。
That gives all the log statements like
这给出了所有日志语句,如
-canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme kindle"
-canOpenURL:URL 失败:“kindle://home” - 错误:“此应用程序不允许查询方案 kindle”
The providers should update their logic for this.
提供者应该为此更新他们的逻辑。
If you need to query for installed apps/available schemes you need to add them to your info.plist
file.
如果您需要查询已安装的应用程序/可用方案,您需要将它们添加到您的info.plist
文件中。
Add the key 'LSApplicationQueriesSchemes' to your plist as an array. Then add strings in that array like 'kindle'.
将键 'LSApplicationQueriesSchemes' 作为数组添加到您的 plist 中。然后在该数组中添加字符串,如“kindle”。
Of course this is not really an option for the banner ads (since those are dynamic), but you can still query that way for your own apps or specific other apps like Twitter and Facebook.
当然,这并不是横幅广告的真正选项(因为它们是动态的),但您仍然可以通过这种方式查询您自己的应用程序或特定的其他应用程序,例如 Twitter 和 Facebook。
Documentation of the canOpenUrl: method canOpenUrl:
canOpenUrl: 方法 canOpenUrl 的文档:
回答by Eike
If you are using CocoaPodsand you want to disable Bitcode for all libraries, use the following command in the Podfile
如果你正在使用CocoaPods并且你想为所有库禁用 Bitcode,请在 Podfile 中使用以下命令
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
回答by miraculixx
Disclaimer: This is intended for those supporting a continuous integrationworkflow that require an automated process. If you don't, please use Xcode as described in Javier's answer.
免责声明:这适用于支持需要自动化流程的持续集成工作流程的人员。如果不这样做,请按照Javier 的回答中所述使用 Xcode 。
This worked for me to set ENABLE_BITCODE = NO
via the command line:
这对我来说ENABLE_BITCODE = NO
通过命令行设置:
find . -name *project.pbxproj | xargs sed -i -e 's/\(GCC_VERSION = "";\)/\ ENABLE_BITCODE = NO;/g'
Note that this is likely to be unstable across Xcode versions. It was tested with Xcode 7.0.1 and as part of a Cordova 4.0 project.
请注意,这可能在 Xcode 版本之间不稳定。它使用 Xcode 7.0.1 进行了测试,并作为 Cordova 4.0 项目的一部分进行了测试。
回答by Phil
To fix the issues with the canOpenURL failing. This is because of the new App Transport Security feature in iOS9
解决 canOpenURL 失败的问题。这是因为 iOS9 中新的 App Transport Security 功能
Read this post to fix that issue http://discoverpioneer.com/blog/2015/09/18/updating-facebook-integration-for-ios-9/
阅读这篇文章以解决该问题http://discoverpioneer.com/blog/2015/09/18/updating-facebook-integration-for-ios-9/
回答by user1119517
This issue has been recently fixed (Nov 2010) by Google, see https://code.google.com/p/analytics-issues/issues/detail?id=671. But be aware that as a good fix it brings more bugs :)
此问题最近已由 Google 修复(2010 年 11 月),请参阅https://code.google.com/p/analytics-issues/issues/detail?id=671。但请注意,作为一个好的修复,它会带来更多的错误:)
You will also have to follow the initialisation method listed here: https://developers.google.com/analytics/devguides/collection/ios/v2.
您还必须遵循此处列出的初始化方法:https: //developers.google.com/analytics/devguides/collection/ios/v2。
The latest instructions are going to give you a headache because it references utilities not included in the pod. Below will fail with the cocoapod
最新的说明会让您头疼,因为它引用了 pod 中未包含的实用程序。下面的 cocoapod 会失败
// Configure tracker from GoogleService-Info.plist.
NSError *configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];
NSAssert(!configureError, @"Error configuring Google services: %@", configureError);