Application crashes in onCreate due to newrelic exception

隐身守侯 提交于 2019-11-30 05:14:56

问题


I've created an Android app using Android Studio beta 0.8.2 and all was going well until the last few days when i started getting this exception just as i run it:

    07-24 14:50:11.044    1176-1176/com.vme.vme I/Crashlytics﹕ Initializing Crashlytics 1.1.11.10
07-24 14:50:11.764    2325-2325/system_process D/MobileDataStateTracker﹕ default: Broadcast received: android.intent.action.ANY_DATA_STATE apnType=default
07-24 14:50:11.769    2325-2325/system_process D/MobileDataStateTracker﹕ default: Received state=CONNECTED, old=CONNECTED, reason=(unspecified)
07-24 14:50:15.079    1176-1176/com.vme.vme W/Crashlytics﹕ Crashlytics initialization was not completed in the allotted time.
07-24 14:50:15.104    1176-1176/com.vme.vme I/dalvikvm﹕ Could not find method com.newrelic.agent.android.instrumentation.Instrumentation.openConnection, referenced from method com.vme.vme.model.network.httpClient.BasicRequestHandler.openConnection
07-24 14:50:15.104    1176-1176/com.vme.vme W/dalvikvm﹕ VFY: unable to resolve static method 30466: Lcom/newrelic/agent/android/instrumentation/Instrumentation;.openConnection (Ljava/net/URLConnection;)Ljava/net/URLConnection;
07-24 14:50:15.104    1176-1176/com.vme.vme D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0009
07-24 14:50:15.114    1176-1176/com.vme.vme I/dalvikvm﹕ Could not find method com.newrelic.agent.android.background.ApplicationStateMonitor.getInstance, referenced from method com.vme.vme.ui.activities_and_fragments.home.bases.VMEBaseActivity.onStart
07-24 14:50:15.114    1176-1176/com.vme.vme W/dalvikvm﹕ VFY: unable to resolve static method 30464: Lcom/newrelic/agent/android/background/ApplicationStateMonitor;.getInstance ()Lcom/newrelic/agent/android/background/ApplicationStateMonitor;
07-24 14:50:15.114    1176-1176/com.vme.vme D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0000
07-24 14:50:15.114    1176-1176/com.vme.vme I/dalvikvm﹕ Could not find method com.newrelic.agent.android.background.ApplicationStateMonitor.getInstance, referenced from method com.vme.vme.ui.activities_and_fragments.home.bases.VMEBaseActivity.onStop
07-24 14:50:15.114    1176-1176/com.vme.vme W/dalvikvm﹕ VFY: unable to resolve static method 30464: Lcom/newrelic/agent/android/background/ApplicationStateMonitor;.getInstance ()Lcom/newrelic/agent/android/background/ApplicationStateMonitor;
07-24 14:50:15.114    1176-1176/com.vme.vme D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0003
07-24 14:50:15.309    1176-1176/com.vme.vme D/AndroidRuntime﹕ Shutting down VM
07-24 14:50:15.309    1176-1176/com.vme.vme W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41797c80)
07-24 14:50:15.429    1176-1176/com.vme.vme E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.vme.vme, PID: 1176
    java.lang.NoClassDefFoundError: com.newrelic.agent.android.background.ApplicationStateMonitor
            at com.vme.vme.ui.activities_and_fragments.home.bases.VMEBaseActivity.onStart(VMEBaseActivity.java)

I never used newrelic in this project, i've searched "newrelic" and can't find it in the whole project.

Things i can share also:

  • I have 2 instance of the studio running all the time, in the other project **i am using newrelic - version 2.426.0 **
  • it's happened on Galaxy S3 and Note 2.
  • Cleaning, rebuilding, closing the studio, uninstalling and reinstalling are fixing the issue. BUT IT COME BACK EVERY ONCE A DAY :(

Please help...


回答1:


The thing that fixed for me was upgrading to the newest gradle version 2.1 and android plugin version to 0.13.3 from right click project folder -> module settings




回答2:


  1. Build your New Relic enabled project
  2. Run gradle --stop from the terminal/command line
  3. Open your non-NR enabled app and clean & rebuild
  4. Run the app

If you still get messages about New Relic in your non-NR app, you can go to the ~/.gradle/caches and remove it. Then try the above steps again.

Newer versions of gradle utilize a daemon which caches New Relic instrumentation. So this will stop the daemon and allow the app to build.

You will also want to upgrade to the latest version of New Relic. 2.426.0 is many versions behind. Go here: http://docs.newrelic.com/docs/releases/android




回答3:


If you still get messages about New Relic in your non-NR app, you can go to the project directory and remove .gradle directory and re-build project.



来源:https://stackoverflow.com/questions/24933298/application-crashes-in-oncreate-due-to-newrelic-exception

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