Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build fails after including this library because of "provided" dependency in build.gradle #35

Open
finsterwalder opened this issue Jan 31, 2023 · 2 comments

Comments

@finsterwalder
Copy link

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.

@yotam-frid
Copy link

Hey @finsterwalder have you managed to find a workaround for this?

@fullStackOasis
Copy link

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'
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants