在模拟器上运行程序报错

创建好了模拟器,运行一个程序时,选择模拟器设备
在这里插入图片描述

没有看到报错,看到studio下方显示install apk,查看模拟器launcher,发现apk已经安装上

直接点击模拟器上的图标,没有成功启动,发现是模拟器 launcher一直在crash,但是之前安装的一个应用可以正常运行
09-06 08:18:26.535 1597 2898 I am_crash: [17428,0,com.google.android.apps.nexuslauncher,1019985477,java.lang.NullPointerException,Remote stack trace:
09-06 08:18:26.535 1597 2898 I am_crash: at android.app.LoadedApk.createAppFactory(LoadedApk.java:224)
09-06 08:18:26.535 1597 2898 I am_crash: at android.app.LoadedApk.(LoadedApk.java:152)
09-06 08:18:26.535 1597 2898 I am_crash: at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2043)
09-06 08:18:26.535 1597 2898 I am_crash: at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1998)
09-06 08:18:26.535 1597 2898 I am_crash: at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1970)

09-06 08:23:51.402 2280 2280 E AndroidRuntime: FATAL EXCEPTION: main
09-06 08:23:51.402 2280 2280 E AndroidRuntime: Process: com.google.android.apps.nexuslauncher, PID: 2280
09-06 08:23:51.402 2280 2280 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)’ on a null object reference
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:1948)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1865)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.IActivityManager S t u b Stub StubProxy.startActivity(IActivityManager.java:4541)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1660)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:4574)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at com.android.launcher3.Launcher.startActivityForResult(SourceFile:1394)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4889)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at com.android.launcher3.Launcher.startActivitySafely(SourceFile:2000)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at com.android.launcher3.Launcher.startAppShortcutOrInfoActivity(SourceFile:1850)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at com.android.launcher3.Launcher.onClick(SourceFile:1703)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.view.View.performClick(View.java:6579)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.view.View.performClickInternal(View.java:6556)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.view.View.access 3100 ( V i e w . j a v a : 777 ) 09 − 0608 : 23 : 51.40222802280 E A n d r o i d R u n t i m e : a t a n d r o i d . v i e w . V i e w 3100(View.java:777) 09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.view.View 3100(View.java:777)090608:23:51.40222802280EAndroidRuntime:atandroid.view.ViewPerformClick.run(View.java:25660)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:819)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6656)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: Caused by: android.os.RemoteException: Remote stack trace:
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.LoadedApk.createAppFactory(LoadedApk.java:224)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.LoadedApk.(LoadedApk.java:152)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2043)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1998)
09-06 08:23:51.402 2280 2280 E AndroidRuntime: at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1970)

使用的Android Studio版本为3.1.1,该问题只在Android P emulator上出现,使用API26的模拟器就是好的.
跟http://www.hackerav.com/?post=67797 这里的问题一样.
先mark一下,还不知道原因…推测应该是该模拟器有问题,因为待机情况下也会出现launcher crash,systemUI crash

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值