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

[10.20.0-beta.1] Incompatibility with react-native-maps and compileSdkVersion 31 #4342

Open
gabrielbull opened this issue Feb 12, 2022 · 2 comments
Labels
Encryption:Off Frequency:Always hermes Bugs and features related to running on the React Native hermes engine O-Community Repro:Always SDK-Use:Local T-Bug

Comments

@gabrielbull
Copy link

gabrielbull commented Feb 12, 2022

How frequently does the bug occur?

All the time

Description

The app will not launch on android when using reactnativemaps and compileSdkVersion version 31 or 32.

Stacktrace & log output

No response

Can you reproduce the bug?

Yes, always

Reproduction Steps

Create a fresh react native project:

npx react-native init MyApp

Apply this patch file:

From 927ec31791e0adf0a5bd5a4a19e5162d9e8e9272 Mon Sep 17 00:00:00 2001
From: Gabriel Bull <[email protected]>
Date: Fri, 11 Feb 2022 23:12:15 -0500
Subject: [PATCH] issue

---
 android/app/build.gradle                 |  9 ++++++++-
 android/app/src/main/AndroidManifest.xml |  7 ++++++-
 android/build.gradle                     | 10 +++++++---
 android/gradle.properties                |  2 +-
 package.json                             |  4 +++-
 5 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/android/app/build.gradle b/android/app/build.gradle
index 4a3f3e0..b3b6a67 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -78,7 +78,7 @@ import com.android.build.OutputFile
  */
 
 project.ext.react = [
-    enableHermes: false,  // clean and rebuild if changing
+    enableHermes: true,  // clean and rebuild if changing
 ]
 
 apply from: "../../node_modules/react-native/react.gradle"
@@ -208,6 +208,13 @@ dependencies {
         exclude group:'com.facebook.flipper'
     }
 
+    implementation(project(':react-native-maps')){
+        exclude group: 'com.google.android.gms', module: 'play-services-base'
+        exclude group: 'com.google.android.gms', module: 'play-services-maps'
+    }
+    implementation 'com.google.android.gms:play-services-base:17.2.1'
+    implementation 'com.google.android.gms:play-services-maps:17.0.0'
+
     if (enableHermes) {
         def hermesPath = "../../node_modules/hermes-engine/android/";
         debugImplementation files(hermesPath + "hermes-debug.aar")
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 5087425..70e360f 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -15,11 +15,16 @@
         android:label="@string/app_name"
         android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
         android:launchMode="singleTask"
-        android:windowSoftInputMode="adjustResize">
+        android:windowSoftInputMode="adjustResize"
+        android:exported="true">
         <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
       </activity>
+      <meta-data
+        android:name="com.google.android.geo.API_KEY"
+        android:value="Your Google maps API Key Here"/>
+      <uses-library android:name="org.apache.http.legacy" android:required="false"/>
     </application>
 </manifest>
diff --git a/android/build.gradle b/android/build.gradle
index 3be1031..affe34b 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -3,10 +3,13 @@
 buildscript {
     ext {
         buildToolsVersion = "30.0.2"
-        minSdkVersion = 21
-        compileSdkVersion = 30
-        targetSdkVersion = 30
+        minSdkVersion = 23
+        compileSdkVersion = 31
+        targetSdkVersion = 31
         ndkVersion = "21.4.7075529"
+        playServicesVersion = "17.0.0"
+        googlePlayServicesVersion = "17.0.0"
+        androidMapsUtilsVersion = "2.3.0"
     }
     repositories {
         google()
@@ -37,6 +40,7 @@ allprojects {
             }
         }
         google()
+        jcenter()
         maven { url 'https://www.jitpack.io' }
     }
 }
diff --git a/android/gradle.properties b/android/gradle.properties
index 11d6e02..d540fb2 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -10,7 +10,7 @@
 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
 # Default value: -Xmx1024m -XX:MaxPermSize=256m
-# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
 
 # When configured, Gradle will run in incubating parallel mode.
 # This option should only be used with decoupled projects. More details, visit
diff --git a/package.json b/package.json
index 23a01c7..d449bc4 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,9 @@
   },
   "dependencies": {
     "react": "17.0.2",
-    "react-native": "0.67.2"
+    "react-native": "0.67.2",
+    "react-native-maps": "^0.30.1",
+    "realm": "10.20.0-beta.1"
   },
   "devDependencies": {
     "@babel/core": "^7.12.9",
-- 
2.32.0 (Apple Git-132)

Version

10.20.0-beta.1

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Android

Build environment

No response

Cocoapods version

No response

@gabrielbull gabrielbull changed the title [10.20.0-beta.1] Incompatibility with react-native-maps and compileSdkVersion/targetSdkVersion 31 [10.20.0-beta.1] Incompatibility with react-native-maps and compileSdkVersion 31 Feb 12, 2022
@fronck fronck added the hermes Bugs and features related to running on the React Native hermes engine label Feb 14, 2022
@fronck
Copy link

fronck commented Feb 14, 2022

@gabrielbull Thank you for reporting this, and for the supplied patch. We will look into the issue.

@sync-by-unito
Copy link

sync-by-unito bot commented Feb 22, 2023

➤ JacobOscarGunnarsson commented:

We need to retest this once v12 is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Encryption:Off Frequency:Always hermes Bugs and features related to running on the React Native hermes engine O-Community Repro:Always SDK-Use:Local T-Bug
Projects
None yet
Development

No branches or pull requests

3 participants