[英]Running react-native project on Android emulator doesn't work
Since I want to use Bluetooth on my application, I downloaded, and linked react-native-ble-plx. 由于我想在我的应用程序上使用蓝牙,我下载并链接react-native-ble-plx。 When I try react-native run-Android I have the following error:
当我尝试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)
And I understand I have wrong SDK version but I have no idea how to update it 我知道我有错误的SDK版本,但我不知道如何更新它
How to update it? 如何更新?
Do I have to create a new React Native project after updating it? 更新后我是否必须创建一个新的React Native项目?
As you can see here https://github.com/Polidea/react-native-ble-plx/blob/master/android/build.gradle the "react-native-ble-plx" has min-sdk of 18 but your project has min-sdk of 16. So you are not eligible to use that library. 正如你在这里看到的那样https://github.com/Polidea/react-native-ble-plx/blob/master/android/build.gradle“react-native-ble-plx ”的min-sdk为18,但你的project的min-sdk为16.所以你没有资格使用该库。 By far the easiest thing that you can do is to go to your "project/android/app/build.gradle" file and increase your own min-sdk to 18
到目前为止,您可以做的最简单的事情是转到“project / android / app / build.gradle”文件并将自己的min-sdk增加到18
Update minimum sdk version in app/build.gradle as. 将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"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.