我可以看到sdkVersion
中有一个app.json
属性,但是我想为该应用程序指定minSdkVersion
。
如何在React Native项目中指定minSdkVersion
?
答案 0 :(得分:2)
You can change it from app/build.gradle
directly
Open the project go to the android/app
folder and open build.gradle
file.
In this you can find
defaultConfig {
applicationId "PACKAGE_ID"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
change this minSdkVersion 16
according to your requirement
答案 1 :(得分:1)
我在android \ build.gradle文件中具有以下设置...
buildscript {
ext {
supportLibVersion = "28.0.0"
buildToolsVersion = "28.0.3"
minSdkVersion = 23
compileSdkVersion = 28
targetSdkVersion = 28
}
}
答案 2 :(得分:0)
您可能想注意到,本机的lib / package / module(根据需要)将minSdkVersion
设置为16
。您可以在他们的官方build.gradle文件中看到它:
android {
compileSdkVersion 28
...
defaultConfig {
minSdkVersion(16)
targetSdkVersion(28)
versionCode(1)
versionName("1.0")
}
...
}
通过将minSdkVersion
设置为16
,react-native使用至少由KitKat版本本地支持的Android API。
您可能会在这里看到官方的Platform Version Dashboard: https://developer.android.com/about/dashboards/index.html