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

iOS Build fails if plugin isn't last one added #178

Closed kkirby closed 7 years ago

kkirby commented 7 years ago

Building iOS will fail with:

ld: warning: directory not found for option '-L/Users/kkirbatski/Library/Developer/Xcode/DerivedData/HelloCordova-epislepkvkacgnaoqycxnydtpcul/Build/Products/Debug-iphonesimulator/UrbanAirship-iOS-SDK'
ld: library not found for -lUrbanAirship-iOS-SDK

if the plugin is not the last plugin added.

I can't find a consistent way to get cordova to install the urbanairship plugin not last, but I've noticed that it happens and when it does this error occurs on build.

rlepinski commented 7 years ago

@kkirby How are you building it? Through xcode or cordova cli?

kkirby commented 7 years ago

cordovacli, though the same issues happens via Xcode. Cordova appears to add the plugins in a non-specific order. But whenever this plugin is not the last one added, that error comes up upon building.

kkirby commented 7 years ago

Though, going off of the plugin.xml of this plugin, it seems more like a bug with cordova and not with this plugin. Thoughts?

-- edit --

Yeah. I was able to build my project with the plugin appearing first and last. When it was first, the project wouldn't build with the above error. When it was last, it built fine. I did a diff on the two projects and the one that didn't build was missing the cocoa pods references inside the .pbxproj. If you give me your email address I can email you the projects so you can see the differences.

rlepinski commented 7 years ago

Could you give me your cordova cli, ios-plugin, and ua plugin versions?

kkirby commented 7 years ago

@rlepinski I sent you an email.

cordova@6.5.0 cordova-ios@4.3.1 ua@6.6.0

-- edit --

Running pod install in the iOS project folder before building fixes the issue. I'm guessing Cordova gets their version of the project file out of sync when pods updates it.

rlepinski commented 7 years ago

@kkirby I was able to reproduce the issue. This is looking more and more like a cordova issue that we should report. Still looking into it.

rlepinski commented 7 years ago

@kkirby Yeah, cordova issue. I can't figure out any automatic workarounds other than to stop using cocoapods. Could you post a issue on https://issues.apache.org ? I am having troubles recovering my account.

kkirby commented 7 years ago

@rlepinski Done