Flurry integrations with Android App gives an error "Could not find class 'com.flurry.sdk.i', referenced from method com.flurry.sdk.hu.a"
Asked Answered
P

1

10

This is what I've tried so far:

public class ScoreUpApp extends Application {
private static ScoreUpApp scoreUpDataCache;
public static final String TAG = "MyApp";

@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();

    // configure Flurry
    FlurryAgent.setLogEnabled(true);
    // init Flurry
    FlurryAgent.init(this, "V88JVYGFF7QX5D9RYZG2");

}
}

This is what the error I get in Logcat:

03-17 14:06:41.924: E/dalvikvm(30175): Could not find class 'com.flurry.sdk.i', referenced from method com.flurry.sdk.hu.a

03-17 14:31:36.694: W/dalvikvm(31798): VFY: unable to resolve const-class 2065 (Lcom/flurry/sdk/i;) in Lcom/flurry/sdk/hu;

Thank you.

Paradox answered 17/3, 2015 at 8:59 Comment(3)
Actually, I have the same problem, I don't know why someone downvoted your question. I thought its something with the classpath, but failed to fix it no matter how I try. I start thinking about switching to Google Analytics, as I can't make it work.Sleep
Anu and @user2855896, do either of you use Proguard? If using gradle, do you have minifyEnabled set to true?Numbles
I haven't used Proguard yet. @UgoParadox
N
9

This warning/error message will happen if you are using just the FlurryAnalytics-X.X.X.jar without the FlurryAds-X.X.X.jar. If you are not interested in the ads, you can just ignore the error as it's just an internal error to the SDK and will not affect your app.

However, if you have already included the ads library as a dependency and you are still seeing this error, it is because Proguard is stripping away the required classes. Make sure your Proguard config has at least the following:

-keep class com.flurry.** { *; }
-dontwarn com.flurry.**
-keepattributes *Annotation*,EnclosingMethod,Signature
-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

# Google Play Services library
-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *

-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

#If you are using the Google Mobile Ads SDK, add the following:
# Preserve GMS ads classes
-keep class com.google.android.gms.ads.** { *;
}
-dontwarn com.google.android.gms.ads.**


#If you are using the InMobi SDK, add the following:
# Preserve InMobi Ads classes
-keep class com.inmobi.** { *;
}
-dontwarn com.inmobi.**
#If you are using the Millennial Media SDK, add the following:
# Preserve Millennial Ads classes
-keep class com.millennialmedia.** { *;
}
-dontwarn com.millennialmedia.**
Numbles answered 24/3, 2015 at 18:23 Comment(3)
@Numbles how to put your above code in android Prouguard?? i have no idea please tell me. getting this errorPantsuit
@Numbles 09-08 15:32:03.680 29649-29670/add.fl.com.myapplication E/dalvikvm: Could not find class 'com.flurry.sdk.by', referenced from method com.flurry.sdk.bz.a 09-08 15:32:03.683 29649-29670/add.fl.com.myapplication E/dalvikvm: Could not find class 'com.flurry.sdk.ca', referenced from method com.flurry.sdk.bz.a 09Pantsuit
@GB_Bhayaniツ You'll have to create a ProGuard rules file and specify these rules in it. The latest Flurry ProGuard recommendation should be here and you can learn more about ProGuard hereNumbles

© 2022 - 2024 — McMap. All rights reserved.