iOS compilation failed with xcode 7.0


After upgrading to Xcode 7.0, now I get this error when compiling for iOS:

clang: error: -fembed-bitcode is not supported on versions of iOS prior to 6.0

Any ideas how to fix it? I’m not really bothered about supporting iOS 6 or older, this seems to just be some default configuration.

Marco Lopes

This should not be enabled if you target earlier versions of iOS:

Actually, maybe it is set on Debug, but not Release EDIT: No, it appears to be set for both. Hmm :confused:

I don’t mind targeting only more recent versions of iOS, how can I change that?

Marco Lopes

Try adding <config:ios deployment="6.0" /> to your project.xml

Tried it, and it solved that problem, but now I’m having a different problem:

Ld build/ normal arm64
cd /Users/mlopes/projects/Personal/StarMiner/Export/ios
export PATH="/Applications/"
/Applications/ -arch arm64 -isysroot /Applications/ -L/Users/mlopes/projects/Personal/StarMiner/Export/ios/build/Release-iphoneos -L/Users/mlopes/projects/Personal/StarMiner/Export/ios/StarMiner/lib/arm64 -F/Users/mlopes/projects/Personal/StarMiner/Export/ios/build/Release-iphoneos -F/Applications/ -filelist /Users/mlopes/projects/Personal/StarMiner/Export/ios/build/ -miphoneos-version-min=6.0 -dead_strip -fembed-bitcode-marker -lstd -lregexp -llime -lgamecenter -lApplicationMain -stdlib=libc++ -framework UIKit -framework OpenAL -framework OpenGLES -framework QuartzCore -framework CoreAudio -framework CoreGraphics -framework AudioToolbox -framework AVFoundation -framework Foundation -framework CoreMotion -framework MediaPlayer -framework GameKit -Xlinker -dependency_info -Xlinker /Users/mlopes/projects/Personal/StarMiner/Export/ios/build/ -o /Users/mlopes/projects/Personal/StarMiner/Export/ios/build/

ld: ‘/Users/mlopes/projects/Personal/StarMiner/Export/ios/StarMiner/lib/arm64/libgamecenter.a(93fbcbe6_ExternalInterface.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 arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


The following build commands failed:
Ld build/ normal arm64

EDIT: I’ve just noticed that the problem seems to be with the Gamecenter library, which seems to be pre-compiled. How can I compile it locally?

I tried running lime rebuild extension-gamecenter ios which didn’t fail, but when I try openfl test ios it fails with the same error.

Perhaps we should try and fix the ENABLE_BITCODE=No case first. I noticed that in the pbxproj there were a couple “Debug” and “Release” project configuration settings, on “native” and one not. Perhaps we need to set this on both sets, and not just the “native” one? (you’ll get what I mean, I think, if you search the source for the templates/iphone/PROJ.xcodeproj)

Then if we can get it to disable, that should get you running, but as for the “enable” setting, we’ll have to look at how to manually compile something with clang for “enable bitcode” and add this to HXCPP’s toolchain files?

Is this in the OpenFL source code? There doesn’t seem to be a folder iphone inside templates:

Also I couldn’t find the file anywhere in OpenFL or in the Exports folder (using find ./ -iname "PROJ.xcodeproj" and find ./ -iname "*xcodeproj").

About the “enable” setting, I guess it depends on why this is happening, I assumed that this is some change that Apple made to the way Xcode 7.x works, and that it will affect everyone who upgrades their xcode, in which case it would be good to have a simple way to address it. But I can’t be sure that this is not something specific of my local system.

Oh, sorry, it’s in the Lime /templates folder :blush:

Ok, tried adding ENABLE_BITCODE = NO; to all the buildSettings on the templates/iphone/PROJ.xcodeproj/project.pbxproj file, but it still shows the same error. Sorry if I’m being thick here, but I don’t really have a lot of experience with Xcode or iOS development, this being my first attempt at an iOS project.

Another way to try and fix this:

1.) Create a new project and open it in Xcode. Copy the generated *.xcodeproj somewhere to keep as a backup

2.) Try and make the edits needed in the Xcode UI to get the warning to go away

3.) Compare the two files using a “diff” tool to see what Xcode changed in order to disable bitcode generation :slight_smile:

After doing that, I’ve managed to compile from xcode, I’m now trying to find which changes are relevant to add to the template file, without much success so far.
So for now, I can compile, if I go to xcode and disable bitcode every time I re-run openfl.

Here’s the diff, maybe it will help someone finding out what I’m missing there:

Try these steps to get better information.

1 Like

Thanks, that helped, I’ve modified the template file and it now compiles. :smiley:

Let me know of any changes we should make to the default template :slight_smile:

Hmm, Xcode here updated to 7.0, and it seems to be building fine without more edits :confused:

I just got the changes from the dev branch, I don’t think there’s a need to make any changes.