G. Hamaide G. Hamaide - 4 months ago 331x
Android Question

React Native Android Splash Screen

I'm trying to build a splash screen for an Android RN app.
I've followed the steps described here : https://www.bignerdranch.com/blog/splash-screens-the-right-way/

Unfortunately, when trying to launch my app, the build is successful but the app crashes saying:

Error type 3
Error: Activity class {com.needlios/com.needlios.MainActivity} does not exist.

Does any one know where this could come from ?

I have the following code :


package com.needlios;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class SplashActivity extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {

Intent intent = new Intent(this, MainActivity.class);


package com.needlios;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;

import java.util.Arrays;
import java.util.List;

public class MainActivity extends ReactActivity {

* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
protected String getMainComponentName() {
return "NeedlIOS";

* Returns whether dev mode should be enabled.
* This enables e.g. the dev menu.
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;

* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),


<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />


OK, well it works now. I just changed the android:name to android:name=".MainActivity" in AndroidManifest.xml

It works but I don't understand why it shows the splash screen though...