react-native-launch-arguments icon indicating copy to clipboard operation
react-native-launch-arguments copied to clipboard

After upgrading from 0.67.4 to 0.69.1 and everything is working on IOS I'm getting this error on android

Open mohamadmek opened this issue 3 years ago • 2 comments

"react-native-launch-arguments": "^3.1.0" that's the version I'm using

That's the error I'm getting:

A problem occurred configuring project ':react-native-launch-arguments'.

Could not resolve all files for configuration ':react-native-launch-arguments:implementation'. Could not resolve com.facebook.react:react-native:+. Required by: project :react-native-launch-arguments

mohamadmek avatar Jul 14 '22 09:07 mohamadmek

Colleague here: The issue we are seeing is that the configuration fails to choose between the debug and release variants.

`* Where: Build file '/Users/rick.hawkins/Development/mobile/participant-mobile/node_modules/react-native-launch-arguments/android/build.gradle' line: 112

  • What went wrong: A problem occurred configuring project ':react-native-launch-arguments'.

Could not resolve all files for configuration ':react-native-launch-arguments:implementation'. Could not resolve com.facebook.react:react-native:+. Required by: project :react-native-launch-arguments > Cannot choose between the following variants of com.facebook.react:react-native:0.69.1: - debugVariantDefaultRuntimePublication - releaseVariantDefaultRuntimePublication All of them match the consumer attributes: - Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.69.1: - Unmatched attributes: - Provides com.android.build.api.attributes.BuildTypeAttr 'debug' but the consumer didn't ask for it - Provides org.gradle.category 'library' but the consumer didn't ask for it - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it - Provides org.gradle.status 'release' but the consumer didn't ask for it - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it - Variant 'releaseVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.69.1: - Unmatched attributes: - Provides com.android.build.api.attributes.BuildTypeAttr 'release' but the consumer didn't ask for it - Provides org.gradle.category 'library' but the consumer didn't ask for it - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it - Provides org.gradle.status 'release' but the consumer didn't ask for it - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it`

Should the build type be being used to disambiguate here?

Dionysiac avatar Jul 15 '22 15:07 Dionysiac

I am seeing the same error here.

Disabling JavaDoc in build.gradle is a workaround until this package is patched:

diff --git a/android/build.gradle b/android/build.gradle
index 1ed7e6e8d383f5b23cc619d61af097282174f92f..fc92a9438da3af3aa0ca8d920f0b50c4bf39d0f0 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -105,18 +105,6 @@ def configureReactNativePom(def pom) {
 afterEvaluate { project ->
     // some Gradle build hooks ref:
     // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
-    task androidJavadoc(type: Javadoc) {
-        source = android.sourceSets.main.java.srcDirs
-        classpath += files(android.bootClasspath)
-        project.getConfigurations().getByName('implementation').setCanBeResolved(true)
-        classpath += files(project.getConfigurations().getByName('implementation').asList())
-        include '**/*.java'
-    }
-
-    task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
-        classifier = 'javadoc'
-        from androidJavadoc.destinationDir
-    }
 
     task androidSourcesJar(type: Jar) {
         archiveClassifier = 'sources'
@@ -135,7 +123,6 @@ afterEvaluate { project ->
 
     artifacts {
         archives androidSourcesJar
-        archives androidJavadocJar
     }
 
     publishing {

renchap avatar Jul 16 '22 14:07 renchap

@iamolegga there is a plan to patch this on the future? :P

I think put this on the android.gradle fixed the problem without remove the JavaDoc code. However I don't know if it is an appropriated solution.

`def myAttribute = Attribute.of("com.android.build.api.attributes.BuildTypeAttr", String)

dependencies.attributesSchema { // registers this attribute to the attributes schema attribute(myAttribute) }

configurations { implementation { attributes { attribute(myAttribute, "release") } } }`

Georgge avatar Nov 01 '22 18:11 Georgge

Hi, I'm ready to merge a PR that's reviewed by anyone else from the community

iamolegga avatar Nov 01 '22 19:11 iamolegga