signed apk Parse error when parsing manifest

混江龙づ霸主 提交于 2019-12-24 07:14:35

问题


When I try to install my signed apk I get a parse error (see logcat). When I install the apk signed with default debug key everything is okay.

this is the logcat output:

08-28 17:12:47.267  23828-23828/com.android.packageinstaller W/PackageInstaller: Parse error when parsing manifest. Discontinuing installation
08-28 17:12:47.267  23828-23828/com.android.packageinstaller W/PackageParser: Skipping dir: /mnt/shell/emulated/0/vertretungsplan-2.0.0.apk
08-28 17:12:47.287  23828-23828/com.android.packageinstaller D/dalvikvm: GC_FOR_ALLOC freed 1414K, 62% free 4110K/10772K, paused 16ms, total 16ms
08-28 17:12:47.287  23828-23828/com.android.packageinstaller I/dalvikvm-heap: Grow heap (frag case) to 5.708MB for 1127536-byte allocation

as it says Parse error when parsing manifest here is my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="de.MayerhoferSimon.Vertretungsplan"
          android:versionCode="6"
          android:versionName="2.0.0">

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

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/Theme.Sherlock.Light.DarkActionBar">
        <activity
                android:name="de.MayerhoferSimon.Vertretungsplan.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="de.MayerhoferSimon.Vertretungsplan.LoginActivity"
                android:label="@string/app_name"
                android:noHistory="true"
                android:excludeFromRecents="true"
                android:screenOrientation="portrait"/>


        <!-- Settings -->
        <activity
                android:name=".Preference.Preferences"
                android:label="@string/menu_settings"
                android:parentActivityName=".MainActivity" >
            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                    android:name="android.support.PARENT_ACTIVITY"
                    android:value=".MainActivity" />

        </activity>

        <activity
                android:name="de.MayerhoferSimon.Vertretungsplan.Preference.KlassenListPreferenceActivity"
                android:label="@string/activity_klassenList"
                android:parentActivityName=".Preference.Preferences" >
            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                    android:name="android.support.PARENT_ACTIVITY"
                    android:value=".Preference.Preferences" />

            <intent-filter>
                <action android:name="de.MayerhoferSimon.Vertretungsplan.Preference.KLASSENLIST"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <service android:name=".RefreshService"/>
    </application>
</manifest>

I see no things there which I should change... My device runs 4.3 even when I change the target sdk version to 18 the error appears.

I use android studio to build and sign my apk.

Is there a way to fix this?


回答1:


I found the problem.

the error only appeared because I installed it from the cyanogenmod file manager.

I tried to install it from email - worked. I tried to install it from adb - worked.




回答2:


I think your missing a

</activity> 

after you second activity LoginActivity just before

<!-- Settings -->


来源:https://stackoverflow.com/questions/18492004/signed-apk-parse-error-when-parsing-manifest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!