Search code examples
androidflurry

Android Flurry Events


I have gone through the tutorial and did exactly what it said. I gave INTERNET,COARSE_LOCATION,FINE_LOCATION permissions. Added jar file in the libraries. It's not working. App is getting crashed at FlurryAgent.onStartSession(). This is the code that I am using as given by them:

@Override
    protected void onStart() {
        super.onStart();
        FlurryAgent.onStartSession(MainActivity.this, MY_KEY);//MY_KEY is key given by them.
    }
    @Override
    protected void onStop() {
        super.onStop();
        FlurryAgent.onEndSession(this);
    }

Here is the stack trace:

08-28 16:52:49.499: E/AndroidRuntime(18639): FATAL EXCEPTION: main
08-28 16:52:49.499: E/AndroidRuntime(18639): java.lang.NoClassDefFoundError: com.flurry.android.FlurryAgent
08-28 16:52:49.499: E/AndroidRuntime(18639):    at com.example.test.MainActivity.onStart(MainActivity.java:31)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1166)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.app.Activity.performStart(Activity.java:3842)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1719)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1765)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.app.ActivityThread.access$1500(ActivityThread.java:158)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:996)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.os.Handler.dispatchMessage(Handler.java:130)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.os.Looper.loop(SourceFile:351)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at android.app.ActivityThread.main(ActivityThread.java:3850)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at java.lang.reflect.Method.invokeNative(Native Method)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at java.lang.reflect.Method.invoke(Method.java:538)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:659)
08-28 16:52:49.499: E/AndroidRuntime(18639):    at dalvik.system.NativeStart.main(Native Method)

Solution

  • It obviously crashes at runtime, you may check that your jar is exported when building apk: in project Properties > Java Build Path, go to the 'Order and Export' folder and fill the checkbox corresponding to your jar. And rebuild.