EasyAR not building in XCode - Bitcode Error

0 votes
asked Aug 6 by thedapperlab (160 points)
Hi,

So, we're trying to build the iOS package on our Windows dev machines and then build the IPA in Xcode from the Unity Build on a Mac system.

But, we get the following error:

'/iOS/beta rebuild/Frameworks/Plugins/iOS/easyar.framework/easyar(easyar-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.

Building with bitcode disabled causes other errors, so does not seem to be an option.

Any idea how to resolve this?

1 Answer

0 votes
answered Aug 7 by kenn (14,050 points)
edited Aug 9 by kenn

Disable bitcode does not usually cause errors, unlike enable it.

So what errors do you meet? 

Building with bitcode disabled causes other errors

commented Aug 9 by thedapperlab (160 points)

I get two errors, both undefined Objective-C symbols:

Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_ARSession", referenced from:

      objc-class-ref in easyar(easyar-arm64-master.o)

  "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:

      objc-class-ref in easyar(easyar-arm64-master.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

...and...

Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_ARSession", referenced from:

      objc-class-ref in easyar(easyar-arm64-master.o)

  "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:

      objc-class-ref in easyar(easyar-arm64-master.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

A simple question from me:  Should I be aiming to build this with Bitcode enabled or disabled?
commented Aug 9 by kenn (14,050 points)
Well, these errors are not related to bitcode.

Simple answer is, you should build with bitcode disabed.

To fix the errors above, use version 4.3 or follow the documents to add ARKit.framework.

In 4.3, you do not need to worry about ARKit or bitcode, it is done in the post build automatically.
commented Aug 9 by thedapperlab (160 points)
Thanks for the quick response.

We are building in Unity 2019.2 for maximum device compatibility, so I don't believe v4.3 is an option for us?  We would prefer to avoid requiring ARKit for the same reason - is there a way to get it to build for 2019.2 without ARKit?
commented Aug 9 by kenn (14,050 points)
ARKit is required in linkage, but not runtime.

You need to add ARKit as OPTIONAL dependency. An OPTIONAL dependency does not require ARKit on device.
commented Aug 9 by thedapperlab (160 points)
Thank you - just realised I could change it to optional when I added it...

Very helpful - now builds successfully, many thanks!
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...