安装失败,并显示消息"INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME"; [英] Installation failed with message "INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME"

查看:106
本文介绍了安装失败,并显示消息"INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在项目中进行了一些软件包名称的重构,现在我不再能够安装我的应用程序.大约在同一时间,我更新到了最新版本的android studio.我认为可能是问题所在,因为我认为我是在升级之前进行重构的,我只是不记得100%

So I was doing some refactoring of package names in my project and now i'm no longer able to install my app. Right around the same time that I updated to the most current version of android studio. I believe that may be the problem because I think i did the refactoring before the upgrade, I just don't remember 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

这是我尝试运行应用程序时的完整错误消息

This is the full error message when I try to run my app

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?

即使我接受删除现有应用程序,它仍然给我一个错误,并且没有安装我的应用程序,更不用说运行它了.

Even when I accept to delete the existing application, It still gives me an error and doesn't install my app let alone run it.

推荐答案

源清单文件中的 package 名称实际上并不是最终在安装的APK中使用的名称.在清单合并过程中,最终的程序包名称基于应用程序的 build.gradle 文件中的 applicationId 值.

The package name in your source manifest file is not actually the one that ends up in the APK being installed. During manifest merging process, the final package name is based on the applicationId value in your app's build.gradle file.

如错误消息所述,程序包名称中至少需要一个..

As the error message says, you need at least one . in the package name.

INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME 的其他原因可以在

Other reasons for INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME can be found in PackageParser#validateName() source.

这篇关于安装失败,并显示消息"INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆