gpt4 book ai didi

android - 设置 minSdkVersion 在 Android Studio 中不起作用

转载 作者:行者123 更新时间:2023-11-29 00:18:10 26 4
gpt4 key购买 nike

<分区>

我有一个全新的项目,我是通过新项目向导启动的,我正在其中试验 Material 和 Android L SDK。我将我的模拟器设置为 sdk L,我的实际设备运行 SDK 19。我尝试创建单独的“productFlavors”,一个用于“L”的“现代”和一个用于 19 的“旧”,最后使用“旧”一个来在设备上运行,但没有用。我终于尝试从我的 build.gradle 中删除 SDK“L”的所有痕迹,甚至在 AndroidManifest.xml 中将最小/目标版本设置为 19 但是当我尝试运行它时,设备选择器仍然以某种方式拾取它“L”是 minSDK。

screenshot of device chooser

我已经同步和重新同步了我的 gradle 构建文件,在运行运行配置之前我已经运行干净了,我什至查看了属性文件以查看是否在某处设置了目标错过了。似乎仅通过使用“L”SDK,minimunTarget 就被固定为“L”,我认为这是不对的。我哪里错了?

这是我的 build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 'android-L'
buildToolsVersion '20.0.0'
defaultConfig {
applicationId 'com.craig.mymaterial'
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
modern {
// minSdkVersion 'L'
// targetSdkVersion 'L'
}
old {
minSdkVersion 19
targetSdkVersion 19
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile 'com.android.support:support-v4:19.+'
}

这是我的 AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.craig.mymaterial" >

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".ItemListActivity"
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=".ItemDetailActivity"
android:label="@string/title_item_detail"
android:parentActivityName=".ItemListActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ItemListActivity" />
</activity>
</application>

</manifest>

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com