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

incompatible with gradle 8.0 #67

Open
imagina opened this issue Apr 14, 2023 · 5 comments
Open

incompatible with gradle 8.0 #67

imagina opened this issue Apr 14, 2023 · 5 comments

Comments

@imagina
Copy link

imagina commented Apr 14, 2023

I'm trying to build my reactNative app for the Android platform, but I get this error "Deprecated Gradle features were used in this build, making them incompatible with Gradle 8.0."
image

@petreg
Copy link

petreg commented Apr 17, 2023

I'm having the same problem.

@larrysingh
Copy link

Same issue as well

@larrysingh
Copy link

@rankarpan I noticed that you authored the release PRs, any solution to this particular issue?

@fabio-jreis
Copy link

Same problem here

@fabio-jreis
Copy link

fabio-jreis commented Sep 26, 2023

Today I used patch-package to patch @iconscout/react-native-unicons@2.0.2 for the project I'm working on.

Deprecated Gradle features were used in this build, making them incompatible with Gradle 8.0.

Here is the diff that solved my problem:

diff --git a/node_modules/@iconscout/react-native-unicons/android/build.gradle b/node_modules/@iconscout/react-native-unicons/android/build.gradle
index 94e9880..21a4e11 100644
--- a/node_modules/@iconscout/react-native-unicons/android/build.gradle
+++ b/node_modules/@iconscout/react-native-unicons/android/build.gradle
@@ -15,7 +15,7 @@ buildscript {
 }
 
 apply plugin: 'com.android.library'
-apply plugin: 'maven'
+apply plugin: 'maven-publish'
 
 // Matches values in recent template from React Native (0.59)
 // https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9
@@ -37,6 +37,13 @@ android {
   lintOptions {
     abortOnError false
   }
+
+    packagingOptions {
+        pickFirst 'lib/x86/libc++_shared.so'
+        pickFirst 'lib/x86_64/libc++_shared.so'
+        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+        pickFirst 'lib/arm64-v8a/libc++_shared.so'
+    }  
 }
 
 repositories {
@@ -81,12 +88,16 @@ def configureReactNativePom(def pom) {
     }
 }
 
+configurations {
+  customConfig.extendsFrom implementation
+}
+
 afterEvaluate { project ->
 
     task androidJavadoc(type: Javadoc) {
         source = android.sourceSets.main.java.srcDirs
         classpath += files(android.bootClasspath)
-        classpath += files(project.getConfigurations().getByName('compile').asList())
+        //classpath += files(project.getConfigurations().getByName('customConfig').asList())
         include '**/*.java'
     }
 
@@ -96,7 +107,7 @@ afterEvaluate { project ->
     }
 
     task androidSourcesJar(type: Jar) {
-        classifier = 'sources'
+        archiveClassifier = 'sources'
         from android.sourceSets.main.java.srcDirs
         include '**/*.java'
     }
@@ -108,18 +119,18 @@ afterEvaluate { project ->
         }
     }
 
-    artifacts {
-        archives androidSourcesJar
-        archives androidJavadocJar
-    }
+    // artifacts {
+    //     archives androidSourcesJar
+    //     archives androidJavadocJar
+    // }
 
     task installArchives(type: Upload) {
         configuration = configurations.archives
-        repositories.mavenDeployer {
-            // Deploy to react-native-event-bridge/maven, ready to publish to npm
-            repository url: "file://${projectDir}/../android/maven"
+        // repositories.mavenDeployer {
+        //     // Deploy to react-native-event-bridge/maven, ready to publish to npm
+        //     repository url: "file://${projectDir}/../android/maven"
 
-            configureReactNativePom pom
-        }
+        //     configureReactNativePom pom
+        // }
     }
 }

This issue body was partially generated by patch-package.

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

4 participants