Flurry initialization error with Android

匆匆过客 提交于 2020-01-02 08:24:31

问题


I have the following error when initialize flurry on Application Class:

04-27 10:57:47.360: W/dalvikvm(26744): VFY: unable to resolve static method 22939: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;.getAdvertisingIdInfo (Landroid/content/Context;)Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
04-27 10:57:47.370: W/dalvikvm(26744): VFY: unable to resolve virtual method 22937: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;.getId ()Ljava/lang/String;
04-27 10:57:47.370: W/dalvikvm(26744): VFY: unable to resolve virtual method 22938: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;.isLimitAdTrackingEnabled ()Z
04-27 10:57:47.510: W/System.err(26744): java.lang.NoClassDefFoundError: com.google.android.gms.ads.identifier.AdvertisingIdClient
04-27 10:57:47.510: W/System.err(26744):    at com.flurry.sdk.fe.n(SourceFile:239)
04-27 10:57:47.515: W/System.err(26744):    at com.flurry.sdk.fe.j(SourceFile:191)
04-27 10:57:47.515: W/System.err(26744):    at com.flurry.sdk.fe.i(SourceFile:154)
04-27 10:57:47.515: W/System.err(26744):    at com.flurry.sdk.fe.a(SourceFile:40)
04-27 10:57:47.520: W/System.err(26744):    at com.flurry.sdk.fe$1.safeRun(SourceFile:83)
04-27 10:57:47.520: W/System.err(26744):    at com.flurry.sdk.hq.run(SourceFile:49)
04-27 10:57:47.525: W/System.err(26744):    at android.os.Handler.handleCallback(Handler.java:615)
04-27 10:57:47.530: W/System.err(26744):    at android.os.Handler.dispatchMessage(Handler.java:92)
04-27 10:57:47.530: W/System.err(26744):    at android.os.Looper.loop(Looper.java:137)
04-27 10:57:47.530: W/System.err(26744):    at android.os.HandlerThread.run(HandlerThread.java:60)
04-27 10:57:47.570: W/System.err(26744): java.lang.NullPointerException
04-27 10:57:47.570: W/System.err(26744):    at com.flurry.sdk.ce.a(SourceFile:52)
04-27 10:57:47.570: W/System.err(26744):    at com.flurry.sdk.go$3.safeRun(SourceFile:59)
04-27 10:57:47.570: W/System.err(26744):    at com.flurry.sdk.hq.run(SourceFile:49)
04-27 10:57:47.570: W/System.err(26744):    at android.os.Handler.handleCallback(Handler.java:615)
04-27 10:57:47.575: W/System.err(26744):    at android.os.Handler.dispatchMessage(Handler.java:92)
04-27 10:57:47.575: W/System.err(26744):    at android.os.Looper.loop(Looper.java:137)
04-27 10:57:47.575: W/System.err(26744):    at android.os.HandlerThread.run(HandlerThread.java:60) 

Then after this all my events and sessions are discarted and aren't visible on flurry dashboard.

I'm using FlurryAnalytics-5.3.0.jar and FlurryAds-5.3.0.jar.

Initialization code:

FlurryAgent.setLogEnabled(BuildConstants.IS_RUNNING_DEBUG);
    if (BuildConstants.IS_RUNNING_DEBUG) {
        FlurryAgent.setLogLevel(Log.VERBOSE);
    } else {
        FlurryAgent.setLogLevel(Log.ERROR);
    }
    FlurryAgent.setLogEvents(true);
    FlurryAgent.setReportLocation(true);
    FlurryAgent.init(context, ImplementationUtils.getAnalyticsKey());

EDIT: I added the following code into the manifest: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> and now i have this error\warning:

04-27 11:30:04.125: W/System.err(28320):    at com.flurry.sdk.fe.n(SourceFile:239)
04-27 11:30:04.130: W/System.err(28320):    at com.flurry.sdk.fe.j(SourceFile:191)
04-27 11:30:04.130: W/System.err(28320):    at com.flurry.sdk.fe.i(SourceFile:154)
04-27 11:30:04.140: W/System.err(28320):    at com.flurry.sdk.fe.a(SourceFile:40)
04-27 11:30:04.140: W/System.err(28320):    at com.flurry.sdk.fe$1.safeRun(SourceFile:83)
04-27 11:30:04.140: W/System.err(28320):    at com.flurry.sdk.hq.run(SourceFile:49)
04-27 11:30:04.185: W/System.err(28320):    at com.flurry.sdk.ce.a(SourceFile:52)
04-27 11:30:04.185: W/System.err(28320):    at com.flurry.sdk.go$3.safeRun(SourceFile:59)
04-27 11:30:04.185: W/System.err(28320):    at com.flurry.sdk.hq.run(SourceFile:49)
04-27 11:30:07.235: W/FlurryAgent(28320): Flurry session created for context:com.foo
04-27 11:30:07.290: W/dalvikvm(28320): Link of class 'Lcom/flurry/sdk/bp;' failed
04-27 11:30:07.290: E/dalvikvm(28320): Could not find class 'com.flurry.sdk.bp', referenced from method com.flurry.sdk.bq.a
04-27 11:30:07.290: W/dalvikvm(28320): VFY: unable to resolve new-instance 2608 (Lcom/flurry/sdk/bp;) in Lcom/flurry/sdk/bq;
04-27 11:30:07.290: W/dalvikvm(28320): Link of class 'Lcom/flurry/sdk/br;' failed
04-27 11:30:07.290: E/dalvikvm(28320): Could not find class 'com.flurry.sdk.br', referenced from method com.flurry.sdk.bq.a
04-27 11:30:07.290: W/dalvikvm(28320): VFY: unable to resolve new-instance 2610 (Lcom/flurry/sdk/br;) in Lcom/flurry/sdk/bq;
04-27 11:30:07.295: W/dalvikvm(28320): Link of class 'Lcom/flurry/sdk/bp;' failed
04-27 11:30:07.300: W/dalvikvm(28320): Link of class 'Lcom/flurry/sdk/br;' failed

回答1:


I was using the google services play for froyo but flurry requires Google Play Services 6+ as a build dependency.

I upgrade also my minSdkVersion from 8 (2.2.x) to 9 (2.3)

After this upgrade everything works fine.




回答2:


Put these two lines on your Application's onCreate() method

    // configure Flurry
    FlurryAgent.setLogEnabled(false);

    // init Flurry
    FlurryAgent.init(this,FLURRY_API_KEY);

This is working perfectly fine for me. Just make sure you are using correct FLURRY_API_KEY. This Works for Analytics part.



来源:https://stackoverflow.com/questions/29892663/flurry-initialization-error-with-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!