3
votes

I am facing this after installing react native image picker when using the npx react-native run-android command.

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.

  • What went wrong: Execution failed for task ':app:processDebugManifest'.

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

2

2 Answers

3
votes

Change the minSdkversion 21. You can change it from android/build.gradle directly Open the project go to the android folder and open build.gradle file. In this you can find

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
    }
}
0
votes

In my case

the answer of this error you just need to add the library in your gradle gradle -> gradle.properties

android.enableJetifier=true