Android - 安装失败,显示消息:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

时间:2015-08-06 12:59:50

标签: android android-manifest

我无法再运行我的应用了,我有错误:

  

失败[INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

我在这里读了很多关于它的其他问题,但到目前为止我还没有找到解决办法,有人可以查看我的清单并告诉我我做错了吗?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kalianey.com.bonnieandclit" >

<application
    android:name="Utils.KYController"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Register"
        android:label="@string/title_activity_register" >
    </activity>
    <activity
        android:name=".People"
        android:label="@string/title_activity_people" >
    </activity>
</application>
</manifest>

编辑:错误日志

Installing kalianey.com.bonnieandclit
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/kalianey.com.bonnieandclit"
pkg: /data/local/tmp/kalianey.com.bonnieandclit
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

编辑2:文件结构的屏幕截图

file structure

2 个答案:

答案 0 :(得分:12)

The error message is non intuitive at all. You have a package that has a capital letter. Utils should be changed to util. Once the package name is changed switch it in your manifest to be:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kalianey.com.bonnieandclit" >

<application
    android:name="utils.KYController"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    <activity
        android:name=".Register"
        android:label="@string/title_activity_register" >
    </activity>
    <activity
        android:name=".People"
        android:label="@string/title_activity_people" >
    </activity>
</application>
</manifest>

Notice Utils.KYController was changed to utils.KYController

Once you make that package name change the problem will be fixed.

答案 1 :(得分:0)

在我的项目中,我有两个包,我将“android.intent.action.MAIN”更改为一个新包,我发现了这个问题。然后我复制到我的旧包中,它就消失了。 myabe它可以帮助你。