安装错误:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

时间:2013-04-15 12:21:33

标签: android android-manifest logcat

我在安装应用程序时遇到了奇怪的问题。

我已创建Google Map V2 example并且其工作正常。 在所有成功之后,我已将JAVA - XML - Manifest文件整合到我的旧项目中。

当我编译我的项目时,没有错误,但是当我试图启动它时,显示我

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED错误。

我正在关注Google Map V2 exmaple的this link

Logcate是strang。我无法找到问题。

我已经尝试了很多相关的Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED错误并遵循该规则,但出了点问题。

Rnd Wrok:

How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in my android application

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED code included

https://groups.google.com/forum/?fromgroups=#!topic/android-developers/RoghZWPRK_s

如果我删除新的示例文件并运行旧项目,那么它运行正常。

请伙计们帮帮我。

清单文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="my.pkg"
    android:versionCode="1"
    android:versionName="1.0" >

    <supports-screens
        android:largeScreens="false"
        android:normalScreens="true"
        android:smallScreens="true" />

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="8" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_LOGS" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_CORSE_LOCATION" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="my.pkg.permission.MAPS_RECEIVE" />

    <permission
        android:name="my.pkg.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:logo="@drawable/app_icon"
        android:theme="@style/mytheme" >
        <activity
            android:name="Splash"
            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="my.pkg.Google_Map" >
        </activity>


        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyAULMOV1ylxC7wvEIP1hP7EeuKr1dKLaVQ" />
    </application>

</manifest>

更新:

Logcate

04-15 17:33:37.685: E/power(1482): *** set_screen_state 1
04-15 17:33:37.692: E/SensorManager(1482): registerListener :: handle = 0  name= BMA222 delay= 60000 Listener= android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:37.692: E/SensorManager(1482): reg :: handle = 0
04-15 17:33:37.786: E/ClockWidget(17093): getOrientation portrait
04-15 17:33:37.786: E/ClockWidget(17093): drawDayText
04-15 17:33:37.786: E/ClockWidget(17093): width= 50
04-15 17:33:37.786: E/ClockWidget(17093): widthText= 58.0
04-15 17:33:37.786: E/ClockWidget(17093): RIGHT
04-15 17:33:37.810: E/Launcher(1587): setWindowOpaque()
04-15 17:33:38.692: E/StatusBarPolicy(1544): ecio: 38
04-15 17:33:38.692: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:40.653: E/power(1482): *** set_screen_state 0
04-15 17:33:40.653: E/SensorManager(1482): unregisterListener:: all sensors,  listener = android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:40.653: W/PowerManagerService(1482): CurLockF mPS:0 mUS=0
04-15 17:33:40.653: W/PowerManagerService(1482): type=FULL_WAKE_LOCK                 'keyguard' AW  (mS=7)  activeT=272
04-15 17:33:40.653: W/PowerManagerService(1482): mPokeLocks.size=0:
04-15 17:33:40.755: E/AndroidRuntime(27309): feature code ==> cannot open file
04-15 17:33:41.021: E/power(1482): *** set_screen_state 1
04-15 17:33:41.052: E/SensorManager(1482): registerListener :: handle = 0  name= BMA222 delay= 60000 Listener= android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:41.052: E/SensorManager(1482): reg :: handle = 0
04-15 17:33:41.146: E/Launcher(1587): setWindowOpaque()
04-15 17:33:41.169: E/ClockWidget(17093): getOrientation portrait
04-15 17:33:41.169: E/ClockWidget(17093): drawDayText
04-15 17:33:41.169: E/ClockWidget(17093): width= 50
04-15 17:33:41.169: E/ClockWidget(17093): widthText= 58.0
04-15 17:33:41.169: E/ClockWidget(17093): RIGHT
04-15 17:33:42.997: W/ActivityManager(1482): No content provider found for: 
04-15 17:33:43.817: E/StatusBarPolicy(1544): ecio: 38
04-15 17:33:43.817: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:46.286: E/power(1482): *** set_screen_state 0
04-15 17:33:46.286: W/PowerManagerService(1482): CurLockF mPS:0 mUS=0
04-15 17:33:46.286: W/PowerManagerService(1482): mPokeLocks.size=0:
04-15 17:33:46.294: E/SensorManager(1482): unregisterListener:: all sensors,  listener = android.view.WindowOrientationListener$SensorEventListenerImpl@406996b8
04-15 17:33:46.364: E/StatusBarPolicy(1544): ecio: 37
04-15 17:33:46.364: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:47.075: W/ActivityManager(1482): No content provider found for: 
04-15 17:33:51.497: E/StatusBarPolicy(1544): ecio: 36
04-15 17:33:51.497: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:54.060: E/StatusBarPolicy(1544): ecio: 35
04-15 17:33:54.060: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:33:56.630: E/StatusBarPolicy(1544): ecio: 33
04-15 17:33:56.630: E/StatusBarPolicy(1544): iconLevel: 4
04-15 17:34:00.005: E/ClockWidget(17093): getOrientation portrait
04-15 17:34:00.005: E/ClockWidget(17093): drawDayText
04-15 17:34:00.005: E/ClockWidget(17093): width= 50
04-15 17:34:00.005: E/ClockWidget(17093): widthText= 58.0
04-15 17:34:00.005: E/ClockWidget(17093): RIGHT
04-15 17:34:01.732: E/StatusBarPolicy(1544): ecio: 32
04-15 17:34:01.732: E/StatusBarPolicy(1544): iconLevel: 4

4 个答案:

答案 0 :(得分:23)

找到解决方案非常困难,因为Logcat说了别的话。最后,我找到了上述查询的解决方案。

问题出在我的包名中:我已将包名的第一个字符设置为大写字母,如Chintan.Khetiya.Package

一般来说,这在我的旧项目中对我有用,但当我尝试在现有项目中实施Google Maps代码时,清单文件不允许使用资本包名中的字母

所以,最后我用chinta.khetiya.package这样的小写字符替换了它,并使用新的包名更新了我的新Google地图密钥。

现在它正在运作。

设置包名时要小心。 See more here

答案 1 :(得分:1)

错误是由于您在清单文件中使用了评论。 你不能在你的Manifest中使用这样的评论:

// new update 

您必须使用XML方式,如下所示:

<!-- new update -->

////编辑:

实际上,在声明权限之前,您使用的是自定义权限。尝试转动这个部分:

<uses-permission android:name="my.pkg.permission.MAPS_RECEIVE" />

    <permission
        android:name="my.pkg.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

<permission
        android:name="my.pkg.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

<uses-permission android:name="my.pkg.permission.MAPS_RECEIVE" />

答案 2 :(得分:1)

您的包裹名称应以小写字母开头。 假设你有:

Com.Example.packagename

将其更改为

com.example.packagename

这将解决您的问题。

答案 3 :(得分:0)

你应该添加android:name =&#34; .Splash&#34;而不是android:name =&#34; Splash&#34;

下面的修改代码::: HAPPY CODING :)

NCHAR(5)