android 解决The application could not be installed: INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION

运行app到真机上时,不能安装的问题以前也经常遇到,一般要么是签名问题,要么是手机授权问题,第一次遇到这么一个奇怪的问题,弄了半天,终于解决了,这里做个记录,防止下次再入坑。

07/19 12:42:06: Launching 'app' on OnePlus PGZ110.

Installation did not succeed.

The application could not be installed: INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION

List of apks:

[0] '/Users/chenqi/Downloads/ServiceDemo3-master/app/build/outputs/apk/debug/app-debug.apk'

Installation failed due to: 'Failed to commit install session 1804001996 with command cmd package install-commit 1804001996. Error: INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed parse during installPackageLI: Failed to read manifest from /data/app/vmdl1804001996.tmp/base.apk: android.content.pm.parsing.component.ParsedService cannot be cast to java.lang.String'

Retry

android 解决The application could not be installed: INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION_第1张图片

 错误信息也不是很具体,只是说不能解析manifest的一个字符串,开发工具也不提示语法错误,鬼知道是什么。

记得前几天还运行得好好的,难道我手机变异了?

就思考这几天干了些啥,突然灵光一动,发现了一个问题,修改后,就好了,


        
    

看到了吗?我增加了一个服务,服务的进程名称少了一个冒号,于是修改后,

        
    

这个错误日志真是服了you,这下又可以开心的玩耍了。

你可能感兴趣的:(Android,android,android,studio)