395

I have this new warning about the Google Framework in my app:

(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 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:

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

All of these problems were not present in iOS 8.

Cœur
  • 37,241
  • 25
  • 195
  • 267
C.Farrugia
  • 4,116
  • 3
  • 14
  • 12
  • So you've enabled bitcode in your Xcode target? – Droppy Jun 15 '15 at 14:51
  • Sorry I am new to this, can you tell me how please? – C.Farrugia Jun 15 '15 at 14:53
  • I've never done it, but it looks to be something you have to set deliberately. You appear to have done that. – Droppy Jun 15 '15 at 14:57
  • 4
    @Droppy AFAIK the setting is turned on by default, but you can deactivate it any time in your project settings. – HAS Jun 15 '15 at 15:04
  • I turned them off and all the warnings went away. I researched a bit and Google needs to update their framework for this error to be off, until now just turning it off will work. Does anyone know about the -canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme kindle" ? This I have no idea what Xcode is talking about – C.Farrugia Jun 15 '15 at 15:13
  • @Droppy: It IS turned on by default, as in if the project does not explicitly override the value for that option, the default is ON. – user102008 Jun 15 '15 at 21:20
  • Well if it causes unnecessary warnings, that is a bug. – Droppy Jun 16 '15 at 06:34
  • @Droppy: How are the warnings "unnecessary"? – user102008 Jun 17 '15 at 01:18
  • Because it's an optional feature and those warnings have nothing to do with errors in your code. [Apple have confirmed it's on by default](https://forums.developer.apple.com/message/11875#11875). I've raised a bug report about it (21416003). – Droppy Jun 17 '15 at 05:56

7 Answers7

1033

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.

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.

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
Zia
  • 14,622
  • 7
  • 40
  • 59
  • @Centurion the previous google analytics lib is deprecated and does not compile with xcode 7 / ios9 either – zonabi Sep 10 '15 at 16:00
  • 1
    @goelv yes you should be able to submit apps with bitcode disabled. it is optional right now. it may become required in the future. – zonabi Sep 17 '15 at 03:39
  • 2
    Did NOT work for me for archiving. Pre XCODE 7 project was working fine, now can not ARCHIVE even with Enable Bitcode set to NO. This is for the AWS library. – ort11 Oct 01 '15 at 15:01
  • 1
    Still getting the error after disabling Bitcode on all targets. – datWooWoo Oct 12 '15 at 00:20
113

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:

  1. Update your library with bit code,
  2. Say NO to Enable Bitcode in your target Build Settings

Enter image description here

And the Library Build Settings to remove the warnings.

For more information, go to documentation of bitcode in developer library.

And WWDC 2015 Session 102: "Platforms State of the Union"

Enter image description here

ChenYilong
  • 8,543
  • 9
  • 56
  • 84
43

In my case for avoiding that problem:

  1. Be sure that you are dealing with Xcode 7, NOT lower versions. In lower version this flag does not exist.

  2. Setup: Project>Build Settings>All>Build Options>Enable Bitcode = NO

enter image description here

luk2302
  • 55,258
  • 23
  • 97
  • 137
  • 2
    So, you will have to recompile the libraries included in your project with XCode7 and with EnableBitcode set to YES. Quite complicated if you are working with 3rd party .a librarires. – Javier Calatrava Llavería Sep 22 '15 at 16:24
15

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.

That gives all the log statements like

-canOpenURL: failed for URL: "kindle://home" - error: "This app is not allowed to query for scheme 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.

Add the key 'LSApplicationQueriesSchemes' to your plist as an array. Then add strings in that array like '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.

Documentation of the canOpenUrl: method canOpenUrl:

Documentation about the LSApplicationQueriesSchemes key

Saren Inden
  • 3,450
  • 4
  • 32
  • 45
  • Supposed that a static library will check a parent app deeplink, how to use exception 'LSApplicationQueriesSchemes' in the static library? Normally you do not have a Info.plist for that. – loretoparisi Sep 15 '15 at 14:22
  • I'm not really sure about that, if a library needs to check for apps outside it's parent the parent should define the url's in it's info.plist (so document it for the framework). If canOpenUrl also returns no will the parent app can handle it, than you should (i assume) also include those in the info.plist – Saren Inden Sep 16 '15 at 08:59
14

If you are using CocoaPods and you want to disable Bitcode for all libraries, use the following command in the 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
Eike
  • 2,311
  • 20
  • 31
8

Disclaimer: This is intended for those supporting a continuous integration workflow that require an automated process. If you don't, please use Xcode as described in Javier's answer.

This worked for me to set ENABLE_BITCODE = NO via the command line:

find . -name *project.pbxproj | xargs sed -i -e 's/\(GCC_VERSION = "";\)/\1\ 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.

Community
  • 1
  • 1
miraculixx
  • 10,034
  • 2
  • 41
  • 60
2

To fix the issues with the canOpenURL failing. This is because of the new App Transport Security feature in iOS9

Read this post to fix that issue http://discoverpioneer.com/blog/2015/09/18/updating-facebook-integration-for-ios-9/

Phil
  • 1,077
  • 1
  • 11
  • 18