因此,我在项目中对包名称进行了一些重构,现在我无法再安装我的应用程序。大约在同一时间,我更新到了 android studio 的最新版本。我相信这可能是问题所在,因为我认为我在升级之前进行了重构,我只是不记得 100%
这是我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dodgingfire" >
<application
android:allowBackup="true"
android:icon="@mipmap/dodging_fire_icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".gamemain.GameMainActivity"
android:label="@string/app_name"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
这就是我整理包裹的方式
http://prntscr.com/gcrw99 http://prntscr.com/gcrw99
这是我尝试运行我的应用程序时的完整错误消息
Installation failed with message Failed to finalize session : INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: Invalid manifest package: must have at least one '.' separator.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
即使我接受删除现有应用程序,它仍然会给我一个错误,并且不会安装我的应用程序,更不用说运行它了。
The package
源清单文件中的名称实际上并不是最终安装的 APK 中的名称。在清单合并过程中,最终的包名称基于applicationId
在您的应用程序中的价值build.gradle
file.
正如错误消息所示,您至少需要一个.
在包名称中。
其他原因INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME
可以找到PackageParser#validateName() source http://androidxref.com/7.1.1_r6/xref/frameworks/base/core/java/android/content/pm/PackageParser.java#1360.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)