swift-unity icon indicating copy to clipboard operation
swift-unity copied to clipboard

How To Upgrade to Vuforia 7.2 + Unity 2018.1.6f + Xcode 9.4

Open setoelkahfi opened this issue 6 years ago • 10 comments

Vuforia Engine 7.2 introduced a new way of linking Vuforia Engine library files in iOS. Apps should use the dynamically-linked Vuforia.framework instead of the traditional static library (libVuforia.a) & headers.

Just follow the official instruction from Vuforia, with little tweaks:

  1. Find your project build folder, then copy Vuforia.framework from Unity-generated Xcode project in it. screen shot 2018-07-12 at 12 23 01
  2. Remove reference to libVuforia.a and possibly more files with red color inside Unity folder. In my case it's Bulk_Generics_8.cpp.
  3. In the General tab, “Embedded Binaries” section: Press “+” and navigate to & select Vuforia.framework from the 1 step. Make sure "Copy item if need it" checked. (Note – it should then show up both in this list, and the list of linked frameworks below – you shouldn’t need to add it to both)
  4. In the Build Settings tab:
  • Remove the old header file location from "Header search paths"
  • Remove the old static library location from "Library search paths"
  • Verify that "Runpath search paths" contains the string "@executable_path/Frameworks" (it should have been added automatically when you added the framework to the embedded binaries). Without this the app will crash very early in startup, before entering main.
  1. Now you should safely arrange the Vuforia.framework inside your Xcode project.

Tested on Vuforia 7.2 + Unity 2018.1.6f1 + Xcode 9.4.1. Let me know if you face issues.

setoelkahfi avatar Jul 10 '18 07:07 setoelkahfi

Could you post your solution? Would be so awesome !!

melvinrudolph avatar Jul 11 '18 17:07 melvinrudolph

Sure. Maybe a PR for this repository so we can discuss the best practice.

setoelkahfi avatar Jul 12 '18 03:07 setoelkahfi

Okay so most of the errors are gone now but it's still not entirely working. What im left with now is:

Undefined symbols for architecture arm64: "Vuforia::TextTracker::getClassType()", referenced from: _textTrackerSetRegionOfInterest in libVuforiaWrapper.a(TextTracker.o) _textTrackerGetRegionOfInterest in libVuforiaWrapper.a(TextTracker.o) _trackerManagerInitTracker in libVuforiaWrapper.a(TrackerManager.o) _trackerManagerDeinitTracker in libVuforiaWrapper.a(TrackerManager.o) _wordListLoadWordList in libVuforiaWrapper.a(WordList.o) _wordListAddWordsFromFile in libVuforiaWrapper.a(WordList.o) _wordListAddWordU in libVuforiaWrapper.a(WordList.o) ... "Vuforia::Word::getClassType()", referenced from: TypeMapping::getType(int) in libVuforiaWrapper.a(TypeMapping.o) TypeMapping::getTypeID(Vuforia::Type) in libVuforiaWrapper.a(TypeMapping.o) "Vuforia::WordResult::getClassType()", referenced from: _updateQCAR in libVuforiaWrapper.a(Tracker.o) _determineNewWords in libVuforiaWrapper.a(Tracker.o) _wordGetLetterMask in libVuforiaWrapper.a(Tracker.o) _wordGetLetterBoundingBoxes in libVuforiaWrapper.a(Tracker.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Do you have any idea how to fix that ? Couldn't find any working solution for this arm64 error

melvinrudolph avatar Jul 13 '18 14:07 melvinrudolph

That's something I encountered before moving the Vuforia.framework first to my xcode build folder.

Maybe try to clean, restart Xcode, restart your Mac? You know, Xcode :D

setoelkahfi avatar Jul 16 '18 02:07 setoelkahfi

Yeah i also had about 200 of these error messages before i tried your solution. These are all gone now, thanks to you, except the ones i mentioned :D maybe i'll find a way

melvinrudolph avatar Jul 16 '18 11:07 melvinrudolph

Hi setoelkahfi, I successfully built demo project, however, I get errors in run time and fails at launch screen

the error is attached. screen shot 2018-08-01 at 4 12 19 pm

My unity is: UNITY_RUNTIME_VERSION = 2018.2.1f1; Xcode is: Version 9.4.1 (9F2000)

ericqqqqq avatar Aug 01 '18 20:08 ericqqqqq

Oh, I forgot my PR that should fix the issue.

@ericqqqqq that's because Unity detect there's a launcher storyboard (which is in your project), but failed to load its launcher (because we don't copy it to our project).

In SplashScreen.mm , the line bool hasStoryboard = [[NSBundle mainBundle] pathForResource: @"LaunchScreen" ofType: @"storyboardc"] != nullptr; will find your default LaunchScreen.storyboard and try to load Unity launch screen, thus the error. The Xcodepostbuild.cs from this project will overwrite these lines for you.

Quick solution is rename your launcher storyboard to something else. Don't remove your launch screen, your app will rejected by AppStore.

Meanwhile I'll update my PR.

setoelkahfi avatar Aug 02 '18 01:08 setoelkahfi

@setoelkahfi thank you very much! I got it!

ericqqqqq avatar Aug 02 '18 01:08 ericqqqqq

Would it be possible to get these instructions added to the README?

capnmidnight avatar Sep 24 '18 20:09 capnmidnight

@capnmidnight I think it's not a problem. You can make the pr based on this.

setoelkahfi avatar Sep 28 '18 16:09 setoelkahfi