React-Native-Local-Resource
React-Native-Local-Resource copied to clipboard
Android build fails after including this library because of "provided" dependency in build.gradle
After including the library as a dependency, we get the following error during our android build:
A problem occurred evaluating project ':react-native-local-resource'.
Could not find method provided() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Your build.gradle file includes a "provided" dependency. I found references, that this is deprecated and should probably be replaced by compileOnly.
Hey @finsterwalder have you managed to find a workaround for this?
I used patch-package to apply this patch. Worked for me:
diff --git a/node_modules/react-native-local-resource/android/build.gradle b/node_modules/react-native-local-resource/android/build.gradle
index ae0b6dc..24520a2 100644
--- a/node_modules/react-native-local-resource/android/build.gradle
+++ b/node_modules/react-native-local-resource/android/build.gradle
@@ -36,6 +36,6 @@ repositories {
}
dependencies {
- provided 'com.facebook.react:react-native:+'
- compile group: 'commons-io', name: 'commons-io', version: '2.6'
+ compileOnly 'com.facebook.react:react-native:+'
+ implementation group: 'commons-io', name: 'commons-io', version: '2.6'
}