iOS 9 中的新警告:"all bitcode will be dropped"

New warnings in iOS 9: "all bitcode will be dropped"

我的应用程序中有关于 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.

Xcode 7 给了我大约 204 个关于同一概念的警告,我无法解决这个问题。此外,我在从我的应用程序访问网络时遇到问题。这是调试区的错误:

-canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme kindle"

所有这些问题在 iOS 8.

中都不存在

您的库是在没有位码的情况下编译的,但是您的项目设置中启用了位码选项。在目标构建设置和库构建设置中说 NOEnable Bitcode 以删除警告。

对于那些想知道是否需要启用位码的人:

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.

https://help.apple.com/xcode/mac/current/#/devbbdc5ce4f

Xcode7之后,bitcode选项会默认开启。如果您的库是在没有 bitcode 的情况下编译的,但是在您的项目设置中启用了 bitcode 选项,您可以:

  1. 使用位代码更新您的库,
  2. 在你的目标 Build Settings
  3. 中对 Enable Bitcode 说不

以及用于删除警告的库构建设置。

有关详细信息,请转到 documentation of bitcode in developer library

WWDC 2015 第 102 节:"Platforms State of the Union"


方法 canOpenUrl 在 iOS 9 中(由于隐私)已更改,不再免费使用。您的横幅广告提供商会检查已安装的应用程序,这样它们就不会显示已安装应用程序的横幅广告。

这给出了所有像

这样的日志语句

-canOpenURL:URL 失败:"kindle://home" - 错误:"This app is not allowed to query for scheme kindle"

供应商应该为此更新他们的逻辑。

如果您需要查询已安装的 apps/available 方案,您需要将它们添加到您的 info.plist 文件中。

将键 'LSApplicationQueriesSchemes' 作为数组添加到您的 plist。然后在该数组中添加字符串,例如 'kindle'.

当然这不是横幅广告的真正选择(因为它们是动态的),但您仍然可以通过这种方式查询您自己的应用程序或特定的其他应用程序,如 Twitter 和 Facebook。

canOpenUrl: 方法的文档 canOpenUrl:

Documentation about the LSApplicationQueriesSchemes key

修复 canOpenURL 失败的问题。这是因为 iOS9

中新的 App Transport Security 功能

阅读此 post 以解决该问题 http://discoverpioneer.com/blog/2015/09/18/updating-facebook-integration-for-ios-9/

就我而言,为了避免这个问题:

  1. 请确保您处理的是 Xcode 7,而不是较低版本。在较低版本中,此标志不存在。

  2. 设置:项目>构建设置>所有>构建选项>启用位码=否

免责声明:这是为那些支持 continuous integration workflow that require an automated process. If you don't, please use Xcode as described in .

的人准备的

这对我来说很有效,可以通过命令行设置 ENABLE_BITCODE = NO

find . -name *project.pbxproj | xargs sed -i -e 's/\(GCC_VERSION = "";\)/\ ENABLE_BITCODE = NO;/g'

请注意,这在 Xcode 个版本中可能不稳定。它作为 Cordova 4.0 项目的一部分使用 Xcode 7.0.1 进行了测试。

如果您正在使用 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

此问题最近已由 Google 修复(2010 年 11 月),请参阅 https://code.google.com/p/analytics-issues/issues/detail?id=671。但请注意,作为一个很好的修复,它会带来更多错误 :)

您还必须遵循此处列出的初始化方法:https://developers.google.com/analytics/devguides/collection/ios/v2

最新的说明会让您头疼,因为它引用了 pod 中未包含的实用程序。以下将因 cocoapod

而失败
// Configure tracker from GoogleService-Info.plist.
NSError *configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];
NSAssert(!configureError, @"Error configuring Google services: %@", configureError);