3

I am directly linking PLCrashReporter in my iOS app without using any external tool and now when I try to compile it on Xcode 7 I get link error:

ld: '.../CrashReporter.framework/CrashReporter(libCrashReporter-iphoneos.a-armv7-master.o)' does not contain 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. for architecture armv7

Where do I get the updated framework or the sources to compile them with bitcode enabled and get rid of the error without disabling bitcode for the full project?

Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75
  • Did you try disabling bitcode on the project? – trojanfoe Sep 11 '15 at 14:36
  • I prefer not as they are a new asset to improve the experience for the users, yet I found the sources and recompiling them. – Fabrizio Bartolomucci Sep 11 '15 at 14:40
  • Most of libraries are not updated with bitcode which are coming form Xcode 7. so for now to remove this waring we need to disable it from setting. Find solution form here http://stackoverflow.com/a/32710815/3647325 – Gaurav Pandey Sep 24 '15 at 06:28
  • It may be so, but how do I update the PLCrashReporter framework to use bit code without having to disable it everywhere, or get an already compiled framework so configured? As said, trying to compile the source on XCode 7 is a nightmare. – Fabrizio Bartolomucci Sep 24 '15 at 07:45
  • No one want disable to use bitcode, Everyone want to do things better, but until PLCrashReporter doesn't update their framework to make compatible with bitcode, you have to disable it. – Gaurav Pandey Sep 24 '15 at 07:57
  • That is what I did in fact, but I already miss the possibility of checking the crashes of the app; this of course until such a service is directly offered by Apple. – Fabrizio Bartolomucci Sep 24 '15 at 09:24
  • For checking crashes of app with exact line responsible for crash, you can also use Crash Reports tool offered by Apple starting from Xcode 6 and thats really great. – Gaurav Pandey Sep 24 '15 at 09:31

5 Answers5

8

I ended up addressing this by building PLCrashReporter 1.2.1 from source. This version is the minimum that has had Xcode 7 and iOS9 fixes merged.

The source is obtained from here: PLCrashReporter 1.2.1

Unzip the downloaded 1.2.1 source into a folder.

Pull the Xcode project inside that folder up within Xcode and add the following to the Custom Compiler Settings "Other C Flags" section of the project build settings: -fembed-bitcode

Next add the following to the Custom Compiler Settings "Other Warning Flags" section of the project build settings: -Wno-error=unused-command-line-argument

Then close the project from the Xcode GUI. The custom settings are necessary because we are going to build from the command line using xcodebuild to avoid the PLCR deprecation errors, and when doing so the default is only -fembed-bitcode-marker when building a framework this way. We are overriding the default behavior, and need to suppress the hard stop warning this causes.

Lastly, from a terminal window prompt within the folder where the zip file of the source including the xcode project file is located run the following:

xcodebuild -configuration Release -target 'Disk Image'

This will run the build and leave the framework in ./build/Release/PLCrashReporter-1.2.1/iOS Framework

Now, these steps will produce a bitcode enabled framework, but third party crash reporting is incompatible with bitcode (when the App Store recompiles you have no way to get the symbol file from that on the fly build).

AppsolutEinfach
  • 1,421
  • 1
  • 14
  • 25
drshock
  • 2,096
  • 2
  • 15
  • 30
  • I executed this suggestion and in fact a framework was produced and I could then import in my project. Yet when I try to archive I get: ld: file is universal (5 slices) but does not contain a(n) armv7k slice: /Users/fbartolom/Documents/cocoa applications/inArrivoHD/CrashReporter.framework/CrashReporter file '/Users/fbartolom/Documents/cocoa applications/inArrivoHD/CrashReporter.framework/CrashReporter' for architecture armv7k As for the third party tools I use QuincyKit that is compiled with my app and so it should also be bitcode enabled. – Fabrizio Bartolomucci Oct 30 '15 at 21:48
  • Yet, after adding this option on Xcode and repeating the procedure, it compiles and archives fine. Now I am trying to submit the app to th store and I hope to have the same luck. – Fabrizio Bartolomucci Oct 30 '15 at 22:10
  • When you submit to App Store be sure to uncheck the "Include bitcode" box at the bottom when using this framework. – drshock Oct 31 '15 at 01:57
  • As amato of fact I followed drshock's suggestion and managed to have both my app and PLCrashReporter with Bit Code enabled - I prefer to follow Apple's suggestions as soon as possible. I am now trying to submit the binary still getting Cannot Verify client error 3000. – Fabrizio Bartolomucci Oct 31 '15 at 08:51
  • @Fabrizio Bartolomucci, I would suggest validating the ipa from Xcode Organizer, then exporting the binary from Xcode (again with bitcode unchecked) for app store type, and instead submitting the ipa binary using Application Loader [link] https://itunesconnect.apple.com/apploader/ApplicationLoader_3.0.dmg – drshock Oct 31 '15 at 13:10
  • The issue was due to the fact I missed the update to Xcode 6.1 and so I could not install on my IOS 9.1 device an so I copied the relative platform from the beta version. This action in some way made iTunes connect assume Xcode itself was a beta version. Anyway now I delete the full installation and reinstalled Xcode for the AppleStore and that specific error had been overcome, unfortunately been overcome by an even more cryptic one: "An error occurred uploading to the iTunes Store" – Fabrizio Bartolomucci Oct 31 '15 at 19:56
  • Hi again, as you may see at: http://stackoverflow.com/questions/33476627/missing-required-architecture-x86-64-in-libmumblekit-a-3-slices I have a similar problem with another library I was not able to fix by your suggestions alone. Could you please gently help? Perhaps the issue may be solved by turning MumbleKit in a framework, bu I have no idea about how to do it. – Fabrizio Bartolomucci Nov 02 '15 at 12:58
  • @drshock i'm trying to understand, why to uncheck the include bitcode? – Syed Absar Dec 08 '15 at 07:56
  • 1
    @SyedAbsar disabling bitcode is/was necessary because the symbolication in any such third party crash reporter library depends on synergy with the dSYM at local build time. With bitcode enabled you have a remote rebuild time dynamic added. You may be able to download the appropriate dSYM in this situation, and if so you can leave it enabled. But if not, you have to disable to symbolicate any reports. – drshock Dec 09 '15 at 11:29
  • Works! Hang up problem under iOS 9 on iPad Air 2 went away :-) – AppsolutEinfach Sep 08 '16 at 16:47
3

There is 2 options.
1. Download PLCrashReporter sources and compile it whit bitcode enabled, and use that in your project.
2. Disable bitcode for your target
Go to your target's Build Settings tab, search for Enable Bitcode set value to NO.

enter image description here

arturdev
  • 10,884
  • 2
  • 39
  • 67
2

This worked for me, in order to include Rollbar framework in my project:

Within my workspace, I first select my project from the Project Navigator -> my project's target -> Build Settings -> Enable Bitcode = NO

enter image description here

Then I select the PODS from the Project Navigator -> Rollbar Target -> Enable Bitcode = NO

enter image description here

Vasfed
  • 18,013
  • 10
  • 47
  • 53
ivoroto
  • 925
  • 12
  • 12
1

Experienced same issue. I built the crash reporter framework from source using https://www.plcrashreporter.org/code

  • Open it in Xcode
  • Select the 'CrashReporter' target with the red bullseye.
  • Build it

Then search in ~/Library/Developer/Xcode/DerivedData/CrashReporter-xxxxxxx to get the .framework bundle

Friggles
  • 634
  • 5
  • 7
  • Yes, in fact by doing in this way it compiles without errors. Now I am trying with bitcode enabled. – Fabrizio Bartolomucci Sep 24 '15 at 10:39
  • Unfortunately when I tried submitting my app the same problem surfaced again. When I now try to compile it again I now get: ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(cf.o)) was built for newer OSX version (10.6) than being linked (10.5) ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(arclite.o)) was built for newer OSX version (10.6) than being linked (10.5) – Fabrizio Bartolomucci Oct 30 '15 at 20:45
0

Unfortunately the issue presented itself again. Also when I try to compile again I get:

ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(cf.o)) was built for newer OSX version (10.6) than being linked (10.5) ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(arclite.o)) was built for newer OSX version (10.6) than being linked (10.5)

Moreover if I set enable bit code at the project level I get an immediate error: target 'CrashReporter-MacOSX-Static' has bitcode enabled (ENABLE_BITCODE = YES), but it is not supported for the 'macosx' platform

What should I do to produce the framework with bitcode enabled?

Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75