Muh*_*baz 4 gradle react-native
使用 npx react-native run-android 命令安装 React Native 图像选择器后,我遇到了这个问题。
D:\WEB SAYLANI\React Native CLI\AwesomeProject>npx react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1222 file(s) to forward-jetify. Using 4 workers... info JS server already running. info Installing the app...
Task :app:processDebugManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings 103 actionable tasks: 2 executed, 101 up-to-date D:\WEB SAYLANI\React Native CLI\AwesomeProject\android\app\src\debug\AndroidManifest.xml Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:react-native-image-picker] D:\WEB SAYLANI\React Native CLI\AwesomeProject\node_modules\react-native-image-picker\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 21, or use tools:overrideLibrary="com.imagepicker" to force usage (may lead to runtime failures)
FAILURE: Build failed with an exception.
Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:react-native-image-picker] D:\WEB SAYLANI\React Native CLI\AwesomeProject\node_modules\react-native-image-picker\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 21, or use tools:overrideLibrary="com.imagepicker" to force usage (may lead to runtime failures)
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 8s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 D:\WEB SAYLANI\React Native CLI\AwesomeProject\android\app\src\debug\AndroidManifest.xml Error: npm ERR! code 1 npm ERR! path D:\WEB SAYLANI\React Native CLI\AwesomeProject npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c react-native run-android
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\home\AppData\Local\npm-cache_logs\2021-01-02T18_04_25_264Z-debug.log
小智 5
更改minSdkversion 21。您可以直接从android/build.gradle更改它打开项目进入android文件夹并打开build.gradle文件。在此你可以找到
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10611 次 |
| 最近记录: |