blakgeek / cordova-plugin-flurryanalytics

Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
23 stars 29 forks source link

Support for Cordova 5? #4

Closed sandymacpherson closed 8 years ago

sandymacpherson commented 9 years ago

I'm trying to install this plugin under Cordova 5 and it is attempting to pull in deprecated plugins like com.google.playservices and android.support.v4 which cause my android build to break. Am I doing something daft or is Cordova 5 not supported?

Note that when this plugin is installed as the only plugin, then the android build works. Attempting to use other plugins (admobpro, facebook connect etc) results in conflicts.

AljosaH commented 9 years ago

I'm also having conflict problems with facebook connect.

The file causing problems is "android-support-v4.jar", because both plugins use it, but they don't use the same version. I managed to get my project to build by raplacing the mentioned file attached to Flurry Analytics plugin with one attached to Facebook Connect plugin. Project did go through build process and I was able to install it on device, but Flurry Analytics is not working. The errors I get in android logs now are:

D/MotionEngine( 429): [@@@ Motion Engine @@@] GetMotionScenarioId 0.325611 0.565032 9.816227 0.000000 0.000000 0.000000 51 20 E/FlurryAgent(10101): Invalid time set for session resumption: 3000 E/dalvikvm(10101): Could not find class 'com.flurry.sdk.i', referenced from method com.flurry.sdk.ho.a W/dalvikvm(10101): VFY: unable to resolve const-class 1527 (Lcom/flurry/sdk/i;) in Lcom/flurry/sdk/ho; D/dalvikvm(10101): VFY: replacing opcode 0x1c at 0x001e E/GooglePlayServicesUtil(10101): The Google Play services resources were not found. Check your project configuration to ensure that the reso urces are included. E/GooglePlayServicesUtil(10101): The Google Play services resources were not found. Check your project configuration to ensure that the reso urces are included. W/PluginManager(10101): THREAD WARNING: exec() call to Keyboard.close blocked the main thread for 27ms. Plugin should use CordovaInterface.g etThreadPool(). I/dalvikvm(10101): Could not find method android.os.StatFs.getAvailableBlocksLong, referenced from method com.flurry.sdk.ez.a W/dalvikvm(10101): VFY: unable to resolve virtual method 1062: Landroid/os/StatFs;.getAvailableBlocksLong ()J D/dalvikvm(10101): VFY: replacing opcode 0x6e at 0x003c

Please report if you manage to make some progress. Thanks.

AljosaH commented 9 years ago

Happy to report that even though the system reported the above errors, the Flurry Events still got logged. So, to make the long story short: I simply replaced the file "android-support-v4.jar" with the one supplied by Facebook Connect plugin and the conflict was gone and analytics work.

blakgeek commented 9 years ago

You are right. There are issues caused by the way the latest Android platform pulls in dependencies for the gradle builds. Replacing the library is the best solution I have found for the time being. I'm trying to find a better less manual way of fixing it though.

Just a note you'll run into the same issue if you're using the facebook plugin and push notifications and number of other plugins that have dependencies on "support vXX" jars.

sandymacpherson commented 9 years ago

I've unfortunately not had as much success as AljosaH has - I managed to get Android to build by commenting out some of the dependencies in the plugin.xml, but the iOS build fails with missing symbols for i386:

"_kSecMatchLimitOne", referenced from: -[FlurryKeychainWrapper dataForKey:] in libFlurry_6.0.0.a(libFlurry.a-i386-master.o) "_kSecReturnData", referenced from: -[FlurryKeychainWrapper dataForKey:] in libFlurry_6.0.0.a(libFlurry.a-i386-master.o) "_kSecValueData", referenced from: -[FlurryKeychainWrapper setData:forKey:] in libFlurry_6.0.0.a(libFlurry.a-i386-master.o) -[FlurryKeychainWrapper updateValueData:forKey:] in libFlurry_6.0.0.a(libFlurry.a-i386-master.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

blakgeek commented 8 years ago

With latest version 1.1.0 the issue of the conflicting support libraries should be fixed. I moved to using gradle dependencies. Give it a shot and see if that resolves the issue.

@sandymacpherson Sometimes you get the missing symbols error because XCode in combination with Cordova doesn't do a good job of adding and removing the frameworks. It's easily fixed by just selecting all of the frameworks and dragging them back into your project.

framework-fix

Alternatively you can just remove and re-add the ios platform.