当我尝试安装我签名的 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>
我没有看到任何我应该改变的东西......即使我将目标 sdk 版本更改为 18,我的设备也会运行 4.3,但会出现错误。
我使用 android studio 来构建和签署我的 apk。
有没有办法来解决这个问题?