我已经完成了教程并完全按照它所说的做了。我给了INTERNET,COARSE_LOCATION,FINE_LOCATION权限。在库中添加了 jar 文件。它不工作。应用程序在FlurryAgent.onStartSession()处崩溃。这是他们给出的我正在使用的代码:
@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);
}
这是堆栈跟踪:
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)