Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ReactNative Android-更改Firebase版本后无法启动activity ComponentInfo_Android_Firebase_React Native - Fatal编程技术网

ReactNative Android-更改Firebase版本后无法启动activity ComponentInfo

ReactNative Android-更改Firebase版本后无法启动activity ComponentInfo,android,firebase,react-native,Android,Firebase,React Native,这是在更改Firebase版本后发生的 这不会发生在我的设备上,只能在Crashlytics中找到 Fatal Exception: java.lang.RuntimeException Unable to start activity ComponentInfo{com.myApp /com.myApp.MainActivity}: java.util.ConcurrentModificationException android.app.ActivityThread.performLaunc

这是在更改Firebase版本后发生的

这不会发生在我的设备上,只能在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)
主要活动

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);
     }
    };
  }
}
变更日志

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"

此状态下发生错误

我通过搜索找到了一个解决方案

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

但我总是犯同样的错误

现在使用

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'
implementation "com.google.firebase:firebase-core:17.2.0"
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'