极力推荐Android 开发大总结文章:欢迎收藏
Android 开发技术文章大总结
1.手机卡在开机动画界面,无法正常进入系统解决方案
卡死在开机动画界面的原因是由RuntimeException: There must be exactly one installer
导致的,部分 adb log 如下:
6 W system_server: Long monitor contention with owner main (1107) at void com.android.server.pm.PackageManagerService.<init>(android.content.Context, com.android.server.pm.Installer, boolean, boolean)(PackageManagerService.java:2543) waiters=0 in void com.android.server.pm.PackageManagerService.lambda$new$0(com.android.server.pm.PackageManagerService, java.util.List, int) for 1.091s
01-01 00:00:43.258 1107 1107 E System : ******************************************
01-01 00:00:43.258 742 792 D AAL : 01-01 12:00:43.084 BL= 358,ESS= 256, 01-01 12:00:43.119 BL= 359,ESS= 256, 01-01 12:00:43.171 BL= 360,ESS= 256, 01-01 12:00:43.206 BL= 361,ESS= 256, 01-01 12:00:43.258 BL= 362,ESS= 256,
01-01 00:00:43.258 1107 1107 E System : ************ Failure starting system services
01-01 00:00:43.258 1107 1107 E System : java.lang.RuntimeException: There must be exactly one installer; found [ResolveInfo{65cb129 com.android.packageinstaller/.InstallStart m=0x608000}, ResolveInfo{2281cae com.google.android.packageinstaller/com.android.packageinstaller.InstallStart m=0x608000}]
01-01 00:00:43.258 1107 1107 E System : at com.android.server.pm.PackageManagerService.getRequiredInstallerLPr(PackageManagerService.java:3612)
01-01 00:00:43.258 1107 1107 E System : at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:3260)
01-01 00:00:43.258 1107 1107 E System : at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:2355)
01-01 00:00:43.258 1107 1107 E System : at com.android.server.SystemServer.startBootstrapServices(SystemServer.java:648)
01-01 00:00:43.258 1107 1107 E System : at com.android.server.SystemServer.run(SystemServer.java:443)
01-01 00:00:43.258 1107 1107 E System : at com.android.server.SystemServer.main(SystemServer.java:304)
01-01 00:00:43.258 1107 1107 E System : at java.lang.reflect.Method.invoke(Native Method)
01-01 00:00:43.258 1107 1107 E System : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
01-01 00:00:43.258 1107 1107 E System : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:891)
01-01 00:00:43.258 1107 1107 D SystemServerTiming: StartPackageManagerService took to complete: 8749ms
01-01 00:00:43.259 1107 1107 E Zygote : System zygote died with exception
01-01 00:00:43.259 1107 1107 E Zygote : java.lang.RuntimeException: There must be exactly one installer; found [ResolveInfo{65cb129 com.android.packageinstaller/.InstallStart m=0x608000}, ResolveInfo{2281cae com.google.android.packageinstaller/com.android.packageinstaller.InstallStart m=0x608000}]
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.server.pm.PackageManagerService.getRequiredInstallerLPr(PackageManagerService.java:3612)
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:3260)
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:2355)
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.server.SystemServer.startBootstrapServices(SystemServer.java:648)
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.server.SystemServer.run(SystemServer.java:443)
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.server.SystemServer.main(SystemServer.java:304)
01-01 00:00:43.259 1107 1107 E Zygote : at java.lang.reflect.Method.invoke(Native Method)
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
01-01 00:00:43.259 1107 1107 E Zygote : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:891)
01-01 00:00:43.259 1107 1107 D AndroidRuntime: Shutting down VM
查看bootprof(adb pull /proc/bootprof .)
界面,确实卡死在PackageManagerService
中,再次查看out
下发现GooglePackageInstaller
与 MtkPackageInstaller
都会在priv-app
目录下生成。
bootprof
解决方案
去掉一个不用的PackageInstall app
即可.
例如:
在 GMS 包里面的 gms\apps\GooglePackageInstaller\Android.mk
把多的PackageInstall
添加到 LOCAL_OVERRIDES_PACKAGES := PackageInstaller MtkPackageInstaller
Android.mk文件如下:
###############################################################################
# GooglePackageInstaller
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := GooglePackageInstaller
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_BUILT_MODULE_STEM := package.apk
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_PRIVILEGED_MODULE := true
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_OVERRIDES_PACKAGES := PackageInstaller MtkPackageInstaller
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
#LOCAL_REQUIRED_MODULES :=
#LOCAL_PREBUILT_JNI_LIBS :=
include $(BUILD_PREBUILT)
长按识别二维码,领福利
至此,本篇已结束,如有不对的地方,欢迎您的建议与指正。同时期待您的关注,感谢您的阅读,谢谢!
如有侵权,请联系小编,小编对此深感抱歉,届时小编会删除文章,立即停止侵权行为,请您多多包涵。
既然都看到这里,领个红包在走吧!
以下两个红包每天都可以领取
1.支付宝首页收缩红包口令522398497 即可免费领取最高99元红包
支付宝首页收缩红包口令522398497 即可免费领取最高99元红包
-
领取最高10元腾讯新闻红包步骤如下:
长按识别二维码,领取腾讯新闻微信红包
小礼物走一走,来简书关注我