Wikitude / wikitude-cordova-plugin

Wikitude's Augmented Reality Plugin for Cordova - working together with the Wikitude SDK library for Android and iOS. Provides image recognition and tracking, geo-based augmente reality and 3D rendering and animations in an augmented reality scene
https://www.wikitude.com
Other
201 stars 182 forks source link

Error when building Cordova iOS with latest version (SDK 7) #121

Closed mryechkin closed 6 years ago

mryechkin commented 6 years ago

Operating System: macOS Sierra (10.12.4) Cordova: 7.0.1 Xcode: 9.0 Beta (9M136h)

Hello,

I'm going through the tutorial for setting up an empty Cordova app with the plugin, and am encountering this error after adding the Wikitude Cordova plugin and trying to build it:

ld: warning: Auto-Linking supplied 'ManagerHUD/Plugins/com.wikitude.phonegap.WikitudePlugin/WikitudeSDK.framework/WikitudeSDK', file was built for unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F ) which is not the architecture being linked (x86_64): ManagerHUD/Plugins/com.wikitude.phonegap.WikitudePlugin/WikitudeSDK.framework/WikitudeSDK
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_WTArchitectStartupConfiguration", referenced from:
      objc-class-ref in WTWikitudePlugin.o
      objc-class-ref in WTARViewController.o
  "_OBJC_CLASS_$_WTArchitectView", referenced from:
      objc-class-ref in WTWikitudePlugin.o
      objc-class-ref in WTARViewController.o
     (maybe you meant: _OBJC_CLASS_$_WTArchitectViewController)
  "_OBJC_CLASS_$_WTAuthorizationRequestManager", referenced from:
      objc-class-ref in WTWikitudePlugin.o
  "_kWTScreenshotSaveModeKey", referenced from:
      -[WTWikitudePlugin didReceiveDidCapturedScreenNotification:] in WTWikitudePlugin.o
  "_kWTScreenshotBundleDirectoryKey", referenced from:
      -[WTWikitudePlugin captureScreen:] in WTWikitudePlugin.o
      -[WTWikitudePlugin didReceiveDidCapturedScreenNotification:] in WTWikitudePlugin.o
  "_kWTUnauthorizedAppleiOSSDKAPIsKey", referenced from:
      ___34-[WTWikitudePlugin requestAccess:]_block_invoke in WTWikitudePlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
    Ld build/emulator/ManagerHUD.app/ManagerHUD normal x86_64
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/mykhaylo.ryechkin/Projects/ManagerHUD/platforms/ios/cordova/build-debug.xcconfig,-workspace,ManagerHUD.xcworkspace,-scheme,ManagerHUD,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone SE,build,CONFIGURATION_BUILD_DIR=/Users/mykhaylo.ryechkin/Projects/ManagerHUD/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/mykhaylo.ryechkin/Projects/ManagerHUD/platforms/ios/build/sharedpch

The project builds fine with cordova build ios before including the plugin, so I know it's not Cordova itself or Xcode. I also didn't have this issue before when using the older version Wikitude Cordova plugin (for SDK (6.1) a week ago.

Any help would be greatly appreciated, thank you

danielguttenberg commented 6 years ago

Good morning,

may I ask how you installed the Wikitude Cordova plugin, exactly?

We currently have an issue with the 7.0.0 release of which I gave a short description of here.

Daniel

mryechkin commented 6 years ago

Hi Daniel,

I installed it they way it's suggested in Step 5 of "Create empty app":

cordova plugin add https://github.com/Wikitude/wikitude-cordova-plugin.git

So if I understand correctly, that issue you described would apply to me as well? If I clone the plugin repo and add the plugin using cordova add plugin, do I just specify the path to the local directory as a parameter there?

Thanks very much for your help!

danielguttenberg commented 6 years ago

Yes. cordova plugin add <some_local_path> is what you want to do.

I would expect cordova plugin add https://github.com/Wikitude/wikitude-cordova-plugin.git to produce a big red error message though.

If there was no such error message; could you check the file size of src/ios/WikitudeSDK.framework/WikitudeSDK file?

Daniel

mryechkin commented 6 years ago

There was no error message, it seemed to add just fine (this was last Thursday, July 13th). But looking at that file size in my project folder it definitely doesn't look right, it's only 134 bytes.

Also I just noticed that the plugin shows up twice in my package.json for some reason:

"com.wikitude.phonegap.WikitudePlugin": "https://github.com/Wikitude/wikitude-cordova-plugin.git",
"com.wikitude.phonegap.wikitudeplugin": "git+https://github.com/Wikitude/wikitude-cordova-plugin.git"

Again, this is from simply following the instructions for "Create empty app", I have not modified anything else, just trying to get it running for the first time.

I will try starting over from scratch and add plugin using the method you describe, and will report back.

Thanks

mryechkin commented 6 years ago

I was able to resolve the issue.

It looks like I needed to install git-lfs and then do git lfs pull after cloning the plugin repo to get the correct files. After that, adding the plugin to my project using cordova plugin add <local_path_to_plugin_repo> worked and I was able to build and run it.

Thanks for your help Daniel!