react-native-android-inapp-updates icon indicating copy to clipboard operation
react-native-android-inapp-updates copied to clipboard

React Native 0.70.x Support

Open retyui opened this issue 2 years ago • 4 comments

To reproduce:

npx react-native init inappUpdates
cd inappUpdates
yarn add kumparan/react-native-android-inapp-updates # use git version to apply unpublished changes
cd android
./gradlew assembleRelease

Error:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/i/tmp/inappUpdates/node_modules/@gurukumparan/react-native-android-inapp-updates/android/build.gradle' line: 123

* What went wrong:
A problem occurred configuring project ':gurukumparan_react-native-android-inapp-updates'.
> Could not resolve all files for configuration ':gurukumparan_react-native-android-inapp-updates:implementation'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :gurukumparan_react-native-android-inapp-updates
      > Cannot choose between the following variants of com.facebook.react:react-native:0.70.6:
          - debugVariantDefaultRuntimePublication
          - releaseVariantDefaultRuntimePublication
        All of them match the consumer attributes:
          - Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.70.6:
              - Unmatched attributes:

Demo repo: https://github.com/retyui/inapp-updates-rn-70

retyui avatar Dec 08 '22 11:12 retyui

Same issue here with react native 0.71.3

GabrielDierks avatar Mar 07 '23 13:03 GabrielDierks

@renopp Any way you could look into this?

GabrielDierks avatar Mar 15 '23 09:03 GabrielDierks

I used patch-package to fix it:

diff --git a/node_modules/@gurukumparan/react-native-android-inapp-updates/android/build.gradle b/node_modules/@gurukumparan/react-native-android-inapp-updates/android/build.gradle
index 12090aa..725b158 100644
--- a/node_modules/@gurukumparan/react-native-android-inapp-updates/android/build.gradle
+++ b/node_modules/@gurukumparan/react-native-android-inapp-updates/android/build.gradle
@@ -108,20 +108,26 @@ def configureReactNativePom(def pom) {
     }
 }
 
+configurations {
+    implementation {
+        canBeResolved = true
+    }
+}
+
 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)
-        classpath += files(project.getConfigurations().getByName('compile').asList())
-        include '**/*.java'
-    }
-
-    task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
-        classifier = 'javadoc'
-        from androidJavadoc.destinationDir
-    }
+//    task androidJavadoc(type: Javadoc) {
+//        source = android.sourceSets.main.java.srcDirs
+//        classpath += files(android.bootClasspath)
+//        classpath += files(project.getConfigurations().getByName('implementation').asList())
+//        include '**/*.java'
+//    }
+
+//    task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
+//        classifier = 'javadoc'
+//        from androidJavadoc.destinationDir
+//    }
 
     task androidSourcesJar(type: Jar) {
         classifier = 'sources'
@@ -140,7 +146,7 @@ afterEvaluate { project ->
 
     artifacts {
         archives androidSourcesJar
-        archives androidJavadocJar
+//        archives androidJavadocJar
     }
 
     publishing {

retyui avatar Mar 23 '23 16:03 retyui

Nice that patch worked for me!

GabrielDierks avatar Mar 28 '23 12:03 GabrielDierks