Changes made to remove kotlin multiple classes issue

  • The issue was :

 

  • Solution

  • Note: Update or add only those dependencies which are needed in your project.
  • update your pkg manager to their latest version*
    • yarn : 1.22.5
    • npm : 6.14.15
  • upgrade your gradle to latest version* i.e Gradle 7.2
  • android\gradle.properties-
    • adjust head memory changes
    • default
      org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    • updated
      org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
  • android\gradle\wrapper\gradle-wrapper.properties
    • check gradle version as gradle-6.9-all.zip
  • android\build.gradle
    • changes are “**” marked
    • buildscript {
      • ext {
        • **buildToolsVersion = “30.0.2”
        • **minSdkVersion = 21
        • **compileSdkVersion = 30
        • **targetSdkVersion = 30
        • **kotlinVersion = “1.3.72” // add this line
      • }
      • repositories {
        • google()
        • **mavenCentral()
        • jcenter()
      • }
      • dependencies {
        • **classpath ‘com.android.tools.build:gradle:4.2.0’
        • **classpath ‘com.google.gms:google-services:4.3.3’
        • // add this line
          **classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion”
        • classpath ‘com.google.firebase:firebase-crashlytics-gradle:2.2.0’
      • }
    • }
    • allprojects {
      • repositories {
        **mavenCentral()
      • }
    • }
  • android\app\build.gradle
    • defaultConfig {
      • **versionCode 21093001
        //** versionCode

        • first 2 digit – year (21)
        • next 2 digit – month (01 – 12)
        • next 2 digit – date (01 – 31)
        • last 2 digit – attempt made to compile same apk **//
      • **versionName “2.0.2”
      • multiDexEnabled true
    • }
    • **dexOptions {
              incremental true
              javaMaxHeapSize “4g”
        }
    • repositories {
      • // For facebook-android-sdk
        **mavenCentral()
        jcenter()
    • }
    • dependencies {
      • **implementation ‘com.facebook.android:facebook-android-sdk:[8,9)’
      • **implementation “com.google.firebase:firebase-analytics:19.0.0”
      • **implementation ‘com.google.android.gms:play-services-safetynet:17.0.1’
    • }
  • package.json
      • “dependencies”: {
        • **”react”: “^16.14.0”,
        • **”react-dom”: “^16.13.1”,
        • **”react-native”: “0.63.4”,
      • }
Updated on Oct 18, 2021