How to Add a Splash Screen to a React Native App (iOS and Android)
Spencer Carli
4.2K69

I had to add android:exported="true" to the .SplashActivity and .MainActivity Activities in AndroidManifest.xml to avoid an error that occurs when deploying a debug build to my physical Android device from the command line (`react-native run-android`):

Running /usr/local/opt/android-sdk/platform-tools/adb -s ZX1D329QC6 reverse tcp:8081 tcp:8081
Starting the app on ZX1D329QC6 (/usr/local/opt/android-sdk/platform-tools/adb -s ZX1D329QC6 shell am start -n <REDACTED>/<REDACTED>.MainActivity)...
Starting: Intent { cmp=<REDACTED>/.MainActivity }
java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=<REDACTED>/.MainActivity } from null (pid=330, uid=2000) not exported from uid 10141
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2733)
at com.android.commands.am.Am.runStart(Am.java:881)
at com.android.commands.am.Am.onRun(Am.java:359)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:100)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)
Like what you read? Give Derek Greenberg a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.