Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29804

React-native - Stuck on splash screen on android with debug apk

$
0
0

None of the solutions provided to existing questions help. I have no issues with iOS and running on my android device with the development server. But debug-apk is stuck on the splash screen and I can't see anything on the logcat.

Related issue (&package): https://github.com/crazycodeboy/react-native-splash-screen/issues/331

App.js

...
import SplashScreen from 'react-native-splash-screen';
...
componentDidMount() {
    // Alert.alert('Done', 'Hide splash!'); doesn't trigger
    SplashScreen.hide();
}

AndroidManifest.xml

<activity
    android:name=".SplashActivity"
    android:theme="@style/SplashTheme"
    android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>

  <activity
      android:name=".MainActivity"
      android:label="@string/app_name"
      android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
      android:windowSoftInputMode="adjustResize"
      android:exported="true">
  </activity>

MainActivity.java

import org.devio.rn.splashscreen.SplashScreen;
import android.os.Bundle;

public class MainActivity extends ReactActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this);
        super.onCreate(savedInstanceState);
    }
...

SplashActivity.java

...
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.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();
    }
}

Viewing all articles
Browse latest Browse all 29804

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>