yamill / react-native-orientation

Listen to device orientation changes in react-native and set preferred orientation on screen to screen basis.
https://www.npmjs.com/package/react-native-orientation
ISC License
1.72k stars 810 forks source link

add compatibility for Gradle 7.0.0+ on React Native 0.68.1 #407

Open luisabarca opened 2 years ago

luisabarca commented 2 years ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-orientation@3.1.3 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-orientation/android/build.gradle b/node_modules/react-native-orientation/android/build.gradle
index e09fb27..f5b1e04 100644
--- a/node_modules/react-native-orientation/android/build.gradle
+++ b/node_modules/react-native-orientation/android/build.gradle
@@ -16,5 +16,5 @@ android {
 }

 dependencies {
-    compile "com.facebook.react:react-native:+"
+    implementation "com.facebook.react:react-native:+"
 }

This issue body was partially generated by patch-package.

muhammad-ahsan099 commented 2 years ago

That answer is perfect!

Yandamuri commented 2 years ago

I am also facing same issue with Gradle 7.0.0+ on React Native 0.68. I am using react-native-orientation: 3.1.3. The above prescribed solution is working for me too. When will this change be published?