因为我想在我的应用程序上使用蓝牙,所以我下载并链接了react-native-ble-plx。当我尝试react-native run-Android时,我遇到了以下错误:
Task :app:processDebugManifest FAILED
C:\Users\Aurelien\Desktop\Leroy-Somer\AMJE nativ\AMJE\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 18 declared in library [:react-native-ble-plx] C:\Users\Aurelien\Desktop\Leroy-Somer\AMJE nativ\AMJE\node_modules\react-native-ble-plx\android\build\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 18,
or use tools:overrideLibrary="com.polidea.reactnativeble" to force usage (may lead to runtime failures)我知道我有错误的SDK版本,但我不知道如何更新它
如何更新?
我必须在更新后创建一个新的React Native项目吗?
发布于 2019-04-26 19:14:45
正如你在这里看到的,“https://github.com/Polidea/react-native-ble-plx/blob/master/android/build.gradle -native-ble-plx”的min-sdk是18,但是你的项目的min-sdk是16,所以你没有资格使用这个库。到目前为止,你能做的最简单的事情就是进入你的"project/android/app/build.gradle“文件并将你自己的min-sdk增加到18
发布于 2019-04-26 20:21:52
在app/build.gradle中将sdk的最低版本更新为。
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}https://stackoverflow.com/questions/55866076
复制相似问题