my Mainactivity
package com.moa_prod;
import android.os.Bundle;
import com.facebook.react.ReactActivity;
import com.cboy.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 String getMainComponentName() {
SplashScreen.show(this);
return "moa_prod";
}
}
its keep crushing app not working and when i commit the
SplashScreen.show(this);
then nothing happens splash-screen not working .
i did all what readme me say any help please !
here is my MainApplication
package com.moa_prod;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.cboy.rn.splashscreen.SplashScreenReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new SplashScreenReactPackage(),
new VectorIconsPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
I'm experiencing this too.
Has anyone found a fix for this? Getting the same answer
I was (stupidly) calling SplashScreen.show in MainApplication instead of
MainActivity. Double check that you're not doing that :)
I thought I wasn't, and it turned out I was.
On Wed, Mar 15, 2017 at 10:35 AM MeganGilligan1 notifications@github.com
wrote:
Has anyone found a fix for this? Getting the same answer
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/crazycodeboy/react-native-splash-screen/issues/40#issuecomment-286820461,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArTS6nNv8Xy1MOMDDPYMpKEPYBFgiu2ks5rmCFpgaJpZM4MdGmG
.
I double checked and its definitely MainActivity! Builds fine but when run on android device just crashes instantly
That happened to me when the launch screen was invalid. Make sure your
launch screen is created as main/res/layouts/launch_screen.xml and make
sure the XML is a valid android style thing (I have no idea what the proper
name for the format is).
If you're just trying to check that it works first, I'd google for some
example launch screen, copy paste the XML, make sure it shows, then modify
it to be yours. The app consistently crashesmd for me whenever the launch
screen was invalid
On Wed, Mar 15, 2017 at 10:38 AM MeganGilligan1 notifications@github.com
wrote:
I double checked and its definitely MainActivity! Builds fine but when run
on android device just crashes instantly—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/crazycodeboy/react-native-splash-screen/issues/40#issuecomment-286821338,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArTS5tQpdkb4XXNx03Q3m5UspS7qRXOks5rmCIigaJpZM4MdGmG
.
Right so got it to work without crashing, folder named incorrectly as layouts rather than layout. Thank you kindly for your help!
You're welcome! This should be more clearly stated in the docs IMO
On Wed, Mar 15, 2017 at 11:02 AM MeganGilligan1 notifications@github.com
wrote:
Right so got it to work without crashing, folder named incorrectly as
layouts rather than layout. Thank you kindly for your help!—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/crazycodeboy/react-native-splash-screen/issues/40#issuecomment-286829041,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArTSz9z9Tkt1TdHE4ViQUbfkk5F0T5Rks5rmCfLgaJpZM4MdGmG
.
@PARAGJYOTI the drawable folder should also be in the same levels as layout?
@PARAGJYOTI it does not help( RN 0.52, Android 7.1
Most helpful comment
That happened to me when the launch screen was invalid. Make sure your
launch screen is created as main/res/layouts/launch_screen.xml and make
sure the XML is a valid android style thing (I have no idea what the proper
name for the format is).
If you're just trying to check that it works first, I'd google for some
example launch screen, copy paste the XML, make sure it shows, then modify
it to be yours. The app consistently crashesmd for me whenever the launch
screen was invalid
On Wed, Mar 15, 2017 at 10:38 AM MeganGilligan1 notifications@github.com
wrote: