Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1539

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

      How frequently does the bug occur?

      All the time

      Description

      The app will not launch on android when using react-native-maps 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:

      Unable to find source-code formatter for language: patch. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      From 927ec31791e0adf0a5bd5a4a19e5162d9e8e9272 Mon Sep 17 00:00:00 2001
      From: Gabriel Bull <me@gabrielbull.com>
      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: