I’m trying to run a fresh react native v0.72.14 project using "react-native-fetch-blob": "^0.10.8"
as part of the dependency. When I try to run npx react-native run-android
or ./gradlew build
in android folder, I got these error messages, anyone have similar issues or know how to fix this problem?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-fetch-blob:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
i’ve already add this to android/settings.gradle
include ':react-native-fetch-blob'
project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android')
add this implementation to android/app/build.gradle
in dependencies
implementation project(':react-native-fetch-blob')
this config to android/build.gradle
subprojects { subprojects ->
if (project['name'] == 'react-native-fetch-blob') {
project.configurations { compile { } }
}
afterEvaluate {project ->
// force libs to use recent buildtools
if (project.hasProperty("android")) {
android {
compileSdkVersion = 33 // change to match your desired version
buildToolsVersion = "33.0.0" // ....
}
}
}
}