urbanairship / urbanairship-cordova

Urban Airship integration with Apache Cordova
https://docs.airship.com/platform/mobile/setup/sdk/cordova/
Other
142 stars 149 forks source link

Undefined symbols for architecture when building with ionic #193

Closed ajcrites closed 7 years ago

ajcrites commented 7 years ago
$ ionic info

Your system information:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.1
ios-sim version: 6.0.0
OS: macOS Sierra
Node Version: v7.10.1
Xcode version: Xcode 8.2.1 Build version 8C1002

I can install the plugin fine with cordova plugin add urbanairship-cordova. When I do ionic build ios I consistently get an error that looks like:

  "_OBJC_CLASS_$_SKStoreReviewController", referenced from:
      objc-class-ref in libUAirship-8.5.2.a(UARateAppAction.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It's not always x86_64; I've seen it with i386. This will occur with a bare bones project using ionic such as https://github.com/ajcrites/ionic-ua-brk

rlepinski commented 7 years ago

@ajcrites Thanks for the report. Looking into it.

We did not run into this problem when we generated the project just from Cordova but we have an idea on what could be causing this. Ill update you when we have a fix.

rlepinski commented 7 years ago

@ajcrites We figured out the issue. We will release a patch on Tuesday after we do more internal testing. Thanks again for the report!

For now, you can probably work around the issue by adding:

#import <StoreKit/StoreKit.h>

to one of the .h files in the generated project or fallback to the previous version.

sredeker commented 7 years ago

@rlepinski, wanted to follow up and see if you are on track to complete this today? Please let us know an ETA so we can coordinate. Thanks!

rlepinski commented 7 years ago

@sredeker We are on track but it probably wont be released until end of day (pacific time).

rlepinski commented 7 years ago

Fixed in 6.9.1. Please reopen if you continue to have the issue.

ajcrites commented 7 years ago

@rlepinski I can't reopen but I'm still getting this issue with the plugin version 6.9.1

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SKStoreReviewController", referenced from:
      objc-class-ref in libUAirship-8.5.3.a(UARateAppAction.o)
ld: symbol(s) not found for architecture x86_64

I wasn't sure what you meant exactly by adding to a generated header file, but I added that #import <StoreKit/StoreKit.h> to platforms/ios/<project>/Plugins/urbanairship-cordova/UAActionRegistry.h and it didn't seem to make a difference.

rlepinski commented 7 years ago

@ajcrites It works for me with a brand new project. Could you try wiping your derived data and building again? rm -rf ~/Library/Developer/Xcode/DerivedData/

rlepinski commented 7 years ago

@ajcrites I just realized you are building with Xcode 8.2, SKStoreReviewController was introduced in iOS 10.3 so it probably requires Xcode 8.3. Could you try updating your Xcode as well?