Java 我在Android Studio上的应用程序崩溃,没有错误
当我在手机上构建应用程序时,我没有收到任何错误。当我运行它时,它几乎立即崩溃,手机上没有任何错误。我有崩溃日志,但我不知道它们是什么意思。如果有人能给我解释一下,那就太好了Java 我在Android Studio上的应用程序崩溃,没有错误,java,android,Java,Android,当我在手机上构建应用程序时,我没有收到任何错误。当我运行它时,它几乎立即崩溃,手机上没有任何错误。我有崩溃日志,但我不知道它们是什么意思。如果有人能给我解释一下,那就太好了 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
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
2020-11-19 16:33:02.301 21041-21061/com.example.testapplication E/MemoryLeakMonitorManager:MemoryLeakMonitor.jar不存在!
2020-11-19 16:33:02.301 21041-21069/com.example.testapplication E/AwareLog:AtomicFileUtils:readFileLines文件不存在:android.util。AtomicFile@2c2215e
2020-11-19 16:33:02.301 21041-21041/com.example.testapplication D/ZrHung.appeyuiprobe:通知runnable启动。
2020-11-19 16:33:02.301 21041-21070/com.example.testapplication D/ZrHung.appeyuiprobe:可运行线程已启动。
2020-11-19 16:33:02.302 21041-21069/com.example.testapplication E/AwareLog:AtomicFileUtils:readFileLines文件不存在:android.util。AtomicFile@f87093f
2020-11-19 16:33:02.314 21041-21041/com.example.testapplication V/ActivityThread:跳过新配置:{1.15 234mcc10mnc[en_GB,ja_GB]ldltr sw423dp w423dp h768dp 408dpi nrml长端口指针-keyb/V/h-nav/h winConfig={mBounds=Rect(0,0-2033,1080)mAppBounds=Rect(0,0-1080,2032)indowingmode=全屏macitytype=undefined}非全屏=0 suim:1 s.178},配置:{1.15 234mcc10mnc[en_GB,ja_GB]ldltr sw423dp w423dp h768dp 408dpi nrml长端口指状键b/v/h-nav/h winConfig={mBounds=Rect(0,0-2033,1080)mAppBounds=Rect(0,0-1080,2032)mWindowingMode=fullscreen mActivityType=0未定义的}非全屏=0 suim:1 s.178}例如:testapplication.com}
2020-11-19 16:33:02.390 21041-21041/com.example.testapplication D/AndroidRuntime:关闭虚拟机
2020-11-19 16:33:02.390 21041-21041/com.example.testapplication W/testapplicatio:访问隐藏方法Lcom/msic/qart/PatchStore;->createDisableExceptionQarthFile(Ljava/lang/Throwable;)Z(黑名单,JNI)
2020-11-19 16:33:02.390 21041-21041/com.example.testapplication E/testapplicatio:[qarth_debug:]获取补丁库::createDisableExceptionQarthFile方法失败。
2020-11-19 16:33:02.395 21041-21041/com.example.testapplication E/AndroidRuntime:致命异常:main
进程:com.example.testapplication,PID:21041
java.lang.RuntimeException:无法实例化activity ComponentInfo{com.example.testapplication/com.example.testapplication.MainActivity}:java.lang.NullPointerException:尝试在空对象引用上调用虚拟方法“android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()”
在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3355)上
位于android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)中
在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)中
在android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)上
位于android.os.Handler.dispatchMessage(Handler.java:112)
位于android.os.Looper.loop(Looper.java:216)
位于android.app.ActivityThread.main(ActivityThread.java:7625)
位于java.lang.reflect.Method.invoke(本机方法)
位于com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
原因:java.lang.NullPointerException:尝试对空对象引用调用虚拟方法“android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()”
位于android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:159)
在android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:157)中
位于android.content.Context.ActainStyleDatAttributes(Context.java:679)
位于androidx.appcompat.app.appcompatedelegateimpl.createSubDecor(appcompatedelegateimpl.java:839)
在androidx.appcompat.app.appcompatedelegateimpl.ensureubdecor(appcompatedelegateimpl.java:806)
位于androidx.appcompat.app.appcompatedelegateimpl.findViewById(appcompatedelegateimpl.java:630)
在androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:223)上
位于com.example.testapplication.MainActivity。(MainActivity.java:14)
位于java.lang.Class.newInstance(本机方法)
位于android.app.AppComponentFactory.InstanceActivity(AppComponentFactory.java:69)
位于androidx.core.app.CoreComponentFactory.InstanceActivity(CoreComponentFactory.java:45)
位于android.app.Instrumentation.newActivity(Instrumentation.java:1224)
位于android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3340)
位于android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)中
在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)中
在android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)上
位于android.os.Handler.dispatchMessage(Handler.java:112)
位于android.os.Looper.loop(Looper.java:216)
位于android.app.ActivityThread.main(ActivityThread.java:7625)
位于java.lang.reflect.Method.invoke(本机方法)
位于com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
2020-11-19 16:33:02.435 21041-21041/com.example.testapplication I/Process:发送信号。PID:21041信号:9
原因:java.lang.NullPointerException:尝试调用虚拟方法“android.content.pm.application”
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
[...]
at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:223)
at com.example.testapplication.MainActivity.<init>(MainActivity.java:14)