我开发了我的第一个Android应用程序,并已成功将其部署到我的Galaxy S4。该应用程序是为API级别19开发的。
当我尝试在较旧的手机(HTC Desire,运行Android 2.3)上安装它时,我收到一条错误消息,说无法解析apk。我猜这是因为应用程序的API级别是19,所以在我的Android清单中将其修改为API级别9,重新生成APK,然后再次尝试将其安装在HTC上。这次它试图安装应用程序,告诉我所请求的权限,但随后给出了错误消息"应用程序未安装"
有人可以从这里建议我的选择吗?我的Android清单如下。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ian.mealtimer"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="9" />
<application
android:name="com.ian.mealtimer.MealTimerApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.ian.mealtimer.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ian.mealtimer.PresetItemsActivity"
android:label="@string/preset_item" >
</activity>
<activity
android:name="com.ian.mealtimer.MealActivity"
android:label="@string/title_activity_meal" >
<!-- android:parentActivityName="com.ian.mealtimer.MainActivity" > -->
<!-- <meta-data -->
<!-- android:name="android.support.PARENT_ACTIVITY" -->
<!-- android:value="com.ian.mealtimer.MainActivity" /> -->
</activity>
<activity
android:name="com.ian.mealtimer.MealItemActivity"
android:label="@string/title_activity_meal_item" >
android:parentActivityName="com.ian.mealtimer.MealActivity" >
<!-- <meta-data -->
<!-- android:name="android.support.PARENT_ACTIVITY" -->
<!-- android:value="com.ian.mealtimer.MealActivity" /> -->
</activity>
<activity
android:name="com.ian.mealtimer.MealItemDetailActivity"
android:label="@string/title_activity_meal_item_detail"
android:parentActivityName="com.ian.mealtimer.MealItemActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.ian.mealtimer.MealItemActivity" />
</activity>
<activity
android:name="com.ian.mealtimer.SelectPresetItemActivity"
android:label="@string/title_activity_select_preset_item" >
</activity>
<activity
android:name="com.ian.mealtimer.SavedMealsActivity"
android:label="@string/title_activity_saved_meals" >
</activity>
<activity
android:name="com.ian.mealtimer.SetMealTimersActivity"
android:label="@string/title_activity_set_meal_timers"
android:parentActivityName="com.ian.mealtimer.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.ian.mealtimer.MainActivity" />
</activity>
<receiver android:name=".AlarmReceiver" >
</receiver>
</application>
<permission
android:name="android.permission.STATUS_BAR_SERVICE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" >
</uses-permission>
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" >
</uses-permission>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" >
</uses-permission>
</manifest>
答案 0 :(得分:0)
当旧安装的应用与新安装的应用发生冲突时,会发生Application not installed
。首先,你首先用api安装它19,然后用api作为9安装它,先卸载它。
<强>溶液强>
首先卸载应用程序,然后使用清单中的android:minSdkVersion="9"
`