6

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

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

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

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED错误。

我正在关注此链接以获取 Google Map V2 示例。

Logcate 很奇怪。我找不到问题。

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

Rnd 工作:

如何在我的 android 应用程序中修复 INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

安装错误:包含 INSTALL_PARSE_FAILED_MANIFEST_MALFORMED 代码

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>

更新 :

登录

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

4 回答 4

22

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

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

一般来说,这在我的旧项目中对我有用,但是当我尝试在现有项目中实现谷歌地图代码时,清单文件不允许在包名称中使用大写字母。

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

现在它正在工作。

所以在设置包名时要小心。在这里查看更多

于 2013-04-16T06:39:09.373 回答
1

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

Com.Example.packagename

将其更改为类似

com.example.packagename

这将解决你的问题。

于 2014-12-17T07:22:06.987 回答
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" />
于 2013-04-15T12:54:54.123 回答
0

您应该添加 android:name=".Splash" 而不是 android:name="Splash"

修改代码如下:::HAPPY CODING :)

<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>
于 2017-03-02T16:59:47.093 回答