ReactNative Android - Unable to start activity ComponentInfo After changing Firebase version

Viewed 432

It happened After changing the Firebase version.

It doesn't happen on my device, it can only be found in Crashlytics.

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.myApp /com.myApp.MainActivity}: java.util.ConcurrentModificationException
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2957)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)


Caused by java.util.ConcurrentModificationException
androidx.collection.SimpleArrayMap.put (SimpleArrayMap.java:482)
androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java:106)
com.facebook.react.ReactActivity.onCreate (ReactActivity.java:43)
com.cotoone.nagizi.MainActivity.onCreate (MainActivity.java:22)
android.app.Activity.performCreate (Activity.java:7183)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

MainActivity

package com.myApp;

import android.os.Bundle;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

import org.devio.rn.splashscreen.SplashScreen;

public class MainActivity extends ReactActivity {

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this,true);  // here
        super.onCreate(savedInstanceState);
    }

    @Override
    protected String getMainComponentName() {
        return "test3";
    }

  @Override
  protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {
     @Override
      protected ReactRootView createRootView() {
      return new RNGestureHandlerEnabledRootView(MainActivity.this);
     }
    };
  }
}

changelog

implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-messaging:18.0.0"
implementation "com.google.firebase:firebase-ads:17.2.1"

to

implementation "com.google.android.gms:play-services-base:17.2.1"
implementation 'com.google.firebase:firebase-messaging:+'
implementation "com.google.firebase:firebase-ads:19.1.0"

An error occurred in this state.

I did this with a solution I found by searching.

implementation "com.google.firebase:firebase-core:16.0.8"

to

implementation "com.google.firebase:firebase-core:17.2.0"

But I keep getting the same error.

now Using

implementation "com.google.android.gms:play-services-base:17.2.1"
implementation "com.google.firebase:firebase-core:17.2.0"
implementation 'com.google.firebase:firebase-messaging:+'
implementation "com.google.firebase:firebase-ads:19.1.0"
implementation "com.google.firebase:firebase-perf:17.0.2"
implementation 'com.google.android.gms:play-services-location:16.0.0'
0 Answers
Related