wix / react-native-notifications

React Native Notifications
MIT License
3.23k stars 763 forks source link

Error after upgrading to React Native 0.72 #975

Closed NeoPCl closed 1 year ago

NeoPCl commented 1 year ago

After upgrading to React Native 0.72 and trying to start the App, I get this error now:

FAILURE: Build failed with an exception.

  • Where: Build file '/repo-template/node_modules/react-native-notifications/lib/android/app/build.gradle' line: 100

  • What went wrong: Execution failed for task ':tasks'.

    Could not create task ':react-native-notifications:testReactNative60DebugUnitTest'. No signature of method: org.gradle.api.reporting.internal.TaskGeneratedSingleDirectoryReport.enabled() is applicable for argument types: (Boolean) values: [true]

callaars commented 1 year ago

A patch for this:

diff --git a/node_modules/react-native-notifications/lib/android/app/build.gradle b/node_modules/react-native-notifications/lib/android/app/build.gradle
index d049e84..383984e 100644
--- a/node_modules/react-native-notifications/lib/android/app/build.gradle
+++ b/node_modules/react-native-notifications/lib/android/app/build.gradle
@@ -96,9 +96,9 @@ android {

     testOptions {
         unitTests.all { t ->
-            reports {
-                html.enabled true
-            }
+            //reports {
+            //    html.enabled true
+            //}
             testLogging {
                 events "PASSED", "SKIPPED", "FAILED", "standardOut", "standardError"
             }
schimini commented 1 year ago

This is also happening with react-native-navigation from wix

abreuthrj commented 1 year ago

A patch for this:

diff --git a/node_modules/react-native-notifications/lib/android/app/build.gradle b/node_modules/react-native-notifications/lib/android/app/build.gradle
index d049e84..383984e 100644
--- a/node_modules/react-native-notifications/lib/android/app/build.gradle
+++ b/node_modules/react-native-notifications/lib/android/app/build.gradle
@@ -96,9 +96,9 @@ android {

     testOptions {
         unitTests.all { t ->
-            reports {
-                html.enabled true
-            }
+            //reports {
+            //    html.enabled true
+            //}
             testLogging {
                 events "PASSED", "SKIPPED", "FAILED", "standardOut", "standardError"
             }

Hey @callaars It worked thanks! I also found in gradle docs (https://docs.gradle.org/7.3/javadoc/org/gradle/api/reporting/Report.html) that it suggests changing the enabled to required().set(). So I replaced it also worked just fine:

diff --git a/node_modules/react-native-notifications/lib/android/app/build.gradle b/node_modules/react-native-notifications/lib/android/app/build.gradle
index d049e84..6456e81 100644
--- a/node_modules/react-native-notifications/lib/android/app/build.gradle
+++ b/node_modules/react-native-notifications/lib/android/app/build.gradle
@@ -97,7 +97,7 @@ android {
     testOptions {
         unitTests.all { t ->
             reports {
-                html.enabled true
+                html.required.set true
             }
             testLogging {
                 events "PASSED", "SKIPPED", "FAILED", "standardOut", "standardError"
GrimDev commented 1 year ago

Is this planned to be fixed or does exists a workaround that doesn't need to soil the dependencies ?

Tchekda commented 1 year ago

Just faced the same issue, also interested in a long-term fix that doesn't involve applying a patch to a dependency

itsmeshusha commented 1 year ago

+1 same problem with android build.

markendy commented 1 year ago

+1 me too have this porblem

tmoubarak commented 1 year ago

same here