与NewRelic的Android集成

时间:2014-11-07 22:11:46

标签: android newrelic

我尝试将newrelic插件集成到我的项目中,但总是崩溃

我包括

  dependencies {
    classpath "com.newrelic.agent.android:agent-gradle-plugin:4.+"
  }

apply plugin: 'new relic'

  compile 'com.newrelic.agent.android:android-agent:4.+'

java.lang.NoClassDefFoundError: com.newrelic.agent.android.instrumentation.AsyncTaskInstrumentation
        at com.kogi.hitchradiolib.HitchBaseApplication$1.handleMessage(HitchBaseApplication.java:677)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5586)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
        at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:0)

这应该有效

buildscript{
    dependencies{
        classpath 'com.newrelic.agent.android:agent-gradle-plugin:4.+'
    }
}
apply pluggin: 'newrelic'
dependencies {
    compile 'com.newrelic.agent.android:android-agent:4.+'
}