Open mobitinker opened 7 years ago
Have you tried adding that to the MainActivity? Just a guess based on this line
java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.splashscreendemo/.MainActivity } from null (pid=1015, uid=2000) not exported from uid 10401
I encountered the same problem, solved by adding android:exported
on my main activity configuration, thanks @spencercarli.
<activity android:name=".MainActivity" android:exported="true" />
But, finally when the splash screen disappears I get a blank screen until the javascript bundle is interpreted so the splash screen does not its job correctly 😞
I found a solution : just added android:theme="@style/SplashTheme"
to my main activity configuration (and removed the SplashScreenActivity
) did the job. It seems too easy, do you see any caveats or reasons why it is a bad idea?
Working off of memory here but doesn't that result in a delay between opening the app and actually getting a result?
Honestly, I need to revisit this. I've tried a handful of different methods and am not sure if this is still the best one.
If you find a better approach, can you please update your Medium article. Thanks for putting this together. 💯
Thanks for your work on this demo!
In running the demo per instructions I received the following with react-native run-android:
BUILD SUCCESSFUL
Total time: 18.194 secs Running /Developer/android-sdk-macosx/platform-tools/adb -s 55a509c5 reverse tcp:8081 tcp:8081 Starting the app on 55a509c5 (/Developer/android-sdk-macosx/platform-tools/adb -s 55a509c5 shell am start -n com.splashscreendemo/.MainActivity)... Starting: Intent { cmp=com.splashscreendemo/.MainActivity } java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.splashscreendemo/.MainActivity } from null (pid=1015, uid=2000) not exported from uid 10401 at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2553) at com.android.commands.am.Am.runStart(Am.java:768) at com.android.commands.am.Am.onRun(Am.java:307) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:102) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:255)
I tried, without luck, to enter this line into the SplashActivity definition in AndroidManifest.xml as recommended in several places on SO: