【发布时间】:2021-03-03 01:50:07
【问题描述】:
当我在手机上构建应用时,我没有收到任何错误。当我运行它时,它几乎立即崩溃,手机上没有错误。我有崩溃日志,但我不知道它们是什么意思。如果有人可以向我解释,那就太好了。
2020-11-19 16:33:02.301 21041-21061/com.example.testapplication E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist!
2020-11-19 16:33:02.301 21041-21069/com.example.testapplication E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@2c2215e
2020-11-19 16:33:02.301 21041-21041/com.example.testapplication D/ZrHung.AppEyeUiProbe: notify runnable to start.
2020-11-19 16:33:02.301 21041-21070/com.example.testapplication D/ZrHung.AppEyeUiProbe: Runnable thread started.
2020-11-19 16:33:02.302 21041-21069/com.example.testapplication E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@f87093f
2020-11-19 16:33:02.314 21041-21041/com.example.testapplication V/ActivityThread: Skipping new config:{1.15 234mcc10mnc [en_GB,ja_GB] ldltr sw423dp w423dp h768dp 408dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 2033, 1080) mAppBounds=Rect(0, 0 - 1080, 2032) mWindowingMode=fullscreen mActivityType=undefined} nonFullScreen=0 suim:1 s.178}, config:{1.15 234mcc10mnc [en_GB,ja_GB] ldltr sw423dp w423dp h768dp 408dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 2033, 1080) mAppBounds=Rect(0, 0 - 1080, 2032) mWindowingMode=fullscreen mActivityType=undefined} nonFullScreen=0 suim:1 s.178} for app:com.example.testapplication
2020-11-19 16:33:02.390 21041-21041/com.example.testapplication D/AndroidRuntime: Shutting down VM
2020-11-19 16:33:02.390 21041-21041/com.example.testapplication W/testapplicatio: Accessing hidden method Lcom/msic/qarth/PatchStore;->createDisableExceptionQarthFile(Ljava/lang/Throwable;)Z (blacklist, JNI)
2020-11-19 16:33:02.390 21041-21041/com.example.testapplication E/testapplicatio: [qarth_debug:] get PatchStore::createDisableExceptionQarthFile method fail.
2020-11-19 16:33:02.395 21041-21041/com.example.testapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.testapplication, PID: 21041
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.testapplication/com.example.testapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3355)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:159)
at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:157)
at android.content.Context.obtainStyledAttributes(Context.java:679)
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:839)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:806)
at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:630)
at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:223)
at com.example.testapplication.MainActivity.<init>(MainActivity.java:14)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
at android.app.Instrumentation.newActivity(Instrumentation.java:1224)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3340)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
2020-11-19 16:33:02.435 21041-21041/com.example.testapplication I/Process: Sending signal. PID: 21041 SIG: 9
【问题讨论】:
-
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference