简体   繁体   English

解析清单时签名的apk解析错误

[英]signed apk Parse error when parsing manifest

When I try to install my signed apk I get a parse error (see logcat). 当我尝试安装签名的APK时,出现解析错误(请参阅logcat)。 When I install the apk signed with default debug key everything is okay. 当我安装带有默认调试密钥签名的apk时,一切都很好。

this is the logcat output: 这是logcat的输出:

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: 正如它说的那样, Parse error when parsing 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. 我没有看到应该更改的内容...即使将目标sdk版本更改为18,我的设备仍运行4.3。

I use android studio to build and sign my apk. 我使用android studio构建和签名我的apk。

Is there a way to fix this? 有没有办法解决这个问题?

I found the problem. 我发现了问题。

the error only appeared because I installed it from the cyanogenmod file manager. 该错误仅出现是因为我从cyanogenmod文件管理器安装了它。

I tried to install it from email - worked. 我尝试从电子邮件安装它-可行。 I tried to install it from adb - worked. 我试图从adb安装它-起作用。

I think your missing a 我想你想念一个

</activity> 

after you second activity LoginActivity just before 在您进行第二次活动LoginActivity之后

<!-- Settings -->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM