0
我是一位Android新手,運行的應用程序在Windows 7上使用最新的Android Studio和Genymotion。最近我在應用程序中添加了Startapp廣告。當我在調試期間運行應用程序時,它運行平穩並顯示我的廣告。當我在發佈模式下運行它時,我得到一個NullPointerException。應用程序在調試模式下平穩運行,但在發佈模式下崩潰
該日誌告訴我,該錯誤是在MainActivity.onCreate中,但不表示違規代碼。我可以忽略的是什麼?我的日誌文件如下所示。
01-31 13:30:13.789 2992-2992/com.censored W/dalvikvm? VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
01-31 13:30:13.793 2992-2992/com.censored I/dalvikvm? Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.n.onSearchRequested
01-31 13:30:13.793 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve interface method 8471: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
01-31 13:30:13.793 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x72 at 0x0002
01-31 13:30:13.793 2992-2992/com.censored I/dalvikvm? Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.n.onWindowStartingActionMode
01-31 13:30:13.793 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve interface method 8475: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
01-31 13:30:13.793 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x72 at 0x0002
01-31 13:30:13.857 2992-2994/com.censored D/dalvikvm? GC_CONCURRENT freed 208K, 3% free 8211K/8455K, paused 12ms+0ms, total 40ms
01-31 13:30:13.869 2992-2992/com.censored D/dalvikvm? DexOpt: couldn't find field Landroid/net/wifi/ScanResult;.timestamp
01-31 13:30:13.869 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve instance field 91
01-31 13:30:13.869 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x53 at 0x0011
01-31 13:30:13.869 2992-2992/com.censored I/dalvikvm? Could not find method android.os.StatFs.getBlockSizeLong, referenced from method com.startapp.android.publish.l.g.a
01-31 13:30:13.869 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve virtual method 747: Landroid/os/StatFs;.getBlockSizeLong()J
01-31 13:30:13.869 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x6e at 0x002c
01-31 13:30:13.873 2992-2992/com.censored I/dalvikvm? Could not find method android.webkit.WebSettings.setMediaPlaybackRequiresUserGesture, referenced from method com.startapp.android.publish.l.g.a
01-31 13:30:13.873 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve virtual method 8595: Landroid/webkit/WebSettings;.setMediaPlaybackRequiresUserGesture (Z)V
01-31 13:30:13.873 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x6e at 0x000b
01-31 13:30:13.877 2992-2992/com.censored I/dalvikvm? Could not find method android.provider.Settings$Global.getInt, referenced from method com.startapp.android.publish.l.g.a
01-31 13:30:13.877 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve static method 768: Landroid/provider/Settings$Global;.getInt (Landroid/content/ContentResolver;Ljava/lang/String;)I
01-31 13:30:13.877 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x71 at 0x001d
01-31 13:30:13.881 2992-2992/com.censored I/dalvikvm? Could not find method android.content.Context.checkSelfPermission, referenced from method com.startapp.android.publish.l.g.a
01-31 13:30:13.881 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve virtual method 240: Landroid/content/Context;.checkSelfPermission (Ljava/lang/String;)I
01-31 13:30:13.881 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x6e at 0x0008
01-31 13:30:13.885 2992-2992/com.censored D/dalvikvm? DexOpt: couldn't find field Landroid/net/wifi/ScanResult;.venueName
01-31 13:30:13.885 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve instance field 92
01-31 13:30:13.885 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x54 at 0x0006
01-31 13:30:13.885 2992-2992/com.censored I/dalvikvm? Could not find method android.provider.Settings$Global.getInt, referenced from method com.startapp.android.publish.l.g.d
01-31 13:30:13.885 2992-2992/com.censored W/dalvikvm? VFY: unable to resolve static method 769: Landroid/provider/Settings$Global;.getInt (Landroid/content/ContentResolver;Ljava/lang/String;I)I
01-31 13:30:13.885 2992-2992/com.censored D/dalvikvm? VFY: replacing opcode 0x71 at 0x000e
01-31 13:30:13.973 2992-2992/com.censored W/System.err? java.lang.NoSuchFieldException: forceOfferWall3D
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at java.lang.Class.getDeclaredField(Class.java:631)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.l.as.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.l.as.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.c.i.<init>(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.c.a.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.c.a.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.c.a.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.ai.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.ai.f(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.ai.d(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.ai.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.s.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.startapp.android.publish.s.a(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.censored.MainActivity.onCreate(Unknown Source)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.app.Activity.performCreate(Activity.java:5008)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.app.ActivityThread.access$600(ActivityThread.java:130)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.os.Looper.loop(Looper.java:137)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at android.app.ActivityThread.main(ActivityThread.java:4745)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at java.lang.reflect.Method.invokeNative(Native Method)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at java.lang.reflect.Method.invoke(Method.java:511)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-31 13:30:13.973 2992-2992/com.censored W/System.err? at dalvik.system.NativeStart.main(Native Method)
01-31 13:30:13.981 2992-2992/com.censored D/AndroidRuntime? Shutting down VM
01-31 13:30:13.985 2992-2992/com.censored W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0xa6287288)
01-31 13:30:14.001 2992-2992/com.censored E/AndroidRuntime? FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.censored/com.censored.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.startapp.android.publish.l.as.a(Unknown Source)
at com.startapp.android.publish.c.i.<init>(Unknown Source)
at com.startapp.android.publish.c.a.a(Unknown Source)
at com.startapp.android.publish.c.a.a(Unknown Source)
at com.startapp.android.publish.c.a.a(Unknown Source)
at com.startapp.android.publish.ai.a(Unknown Source)
at com.startapp.android.publish.ai.f(Unknown Source)
at com.startapp.android.publish.ai.d(Unknown Source)
at com.startapp.android.publish.ai.a(Unknown Source)
at com.startapp.android.publish.s.a(Unknown Source)
at com.startapp.android.publish.s.a(Unknown Source)
at com.censored.MainActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
01-31 13:30:14.065 2992-3019/com.censored I/dalvikvm? Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo, referenced from method com.startapp.android.publish.l.a.c
01-31 13:30:14.065 2992-3019/com.censored W/dalvikvm? VFY: unable to resolve static method 11240: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;.getAdvertisingIdInfo (Landroid/content/Context;)Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
01-31 13:30:14.069 2992-3019/com.censored D/dalvikvm? VFY: replacing opcode 0x71 at 0x0004
01-31 13:30:14.173 2992-2994/com.censored D/dalvikvm? GC_CONCURRENT freed 353K, 6% free 8271K/8711K, paused 12ms+48ms, total 104ms
01-31 13:30:14.721 2992-2994/com.censored D/dalvikvm? GC_CONCURRENT freed 339K, 5% free 8392K/8775K, paused 20ms+12ms, total 40ms
01-31 13:30:16.685 2992-2992/? I/Process? Sending signal. PID: 2992 SIG: 9
你可以發佈你的代碼嗎? – JMR
'2992-3019/com.censored I/dalvikvm?找不到方法com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo,從方法com.startapp.android.publish.l.a.c'引用。 – Stanojkovic
之前的錯誤是。 – JMR