问题描述
当我尝试安装我的签名APK时,我得到了解析错误(请参阅logcat). 当我安装默认调试键的APK时,一切都可以.
这是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
说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>
我在那里看不到什么,我应该改变...... 我的设备运行4.3 即使当我将目标SDK版本更改为18时,出现错误.
我使用Android Studio构建和签名我的APK.
有没有办法修复这个?
推荐答案
我发现了问题.
仅出现错误,因为我从cyanogenmod文件管理器安装它.
我试图从电子邮件中安装它. 我试图从adb工作的安装它.
其他推荐答案
我认为你缺少一个
</activity>
在第2次活动之后,在
之前<!-- Settings -->
问题描述
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?
推荐答案
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.
其他推荐答案
I think your missing a
</activity>
after you second activity LoginActivity just before
<!-- Settings -->