I am trying to create a splash screen for an Android RN application. I followed the steps described here: https://www.bignerdranch.com/blog/splash-screens-the-right-way/
Unfortunately, when I try to launch my application, the assembly will be successful, but the application will fail, saying:
Error type 3 Error: Activity class {com.needlios/com.needlios.MainActivity} does not exist.
Does anyone know where this could have come from?
I have the following code:
SplashScreen.java
package com.needlios; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = new Intent(this, MainActivity.class); startActivity(intent); finish(); } }
MainActivity.java
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 { @Override protected String getMainComponentName() { return "NeedlIOS"; } @Override protected boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), ); } }
AndroidManifest.xml
<activity android:name=".SplashActivity" android:label="@string/app_name" android:theme="@style/SplashTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
source share