bug: Android app stuck at Splash Screen when first running after installation
See original GitHub issueBug Report
Capacitor Version
@capacitor/cli: 4.2.0
@capacitor/core: 4.2.0
@capacitor/android: 4.2.0
@capacitor/ios: 4.2.0
Platform(s)
Android
Current Behavior
After installing an app that created from Capacitor 4 on Android, when first opening it, it stuck at Splash Screen. It is needed to force stop it and run it again to solve the problem.
This is only happened when launchAutoHide: false
is set in capacitor.config.ts
.
Here is the demo: https://streamable.com/thpma9
Everything is OK when I stay at Capacitor 3.
Expected Behavior
The app never stuck at Splash Screen.
Code Reproduction
In capacitor.config.ts
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.example.app',
appName: 'Example App',
webDir: 'www',
bundledWebRuntime: false,
android: {
initialFocus: false
},
plugins: {
SplashScreen: {
useDialog: false,
androidScaleType: "CENTER_CROP",
launchAutoHide: false,
androidSplashResourceName: "splash",
showSpinner: false,
splashFullScreen: true,
splashImmersive: true,
layoutName: "launch_screen",
}
},
cordova: {
preferences: {
ScrollEnabled: 'false',
BackupWebStorage: 'none',
orientation: 'portrait'
}
},
server: {
iosScheme: "ionic"
}
};
export default config;
In ionic-app/android/app/src/main/res/values/styles.xml
, below is added
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
Other Technical Details
npm --version
output: 8.11.0
node --version
output: v16.15.1
pod --version
output (iOS issues only):
Additional Context
To fix this issue, I temporarily downgraded the project to Capacitor 3. In ionic-app/android/app/src/main/res/values/styles.xml
, I changed back the code to
<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:background">#00a5aa</item>
</style>
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:12
Top Results From Across the Web
Android stuck on splash screen on startup · Issue #3218
Issue Description When trying to start my app on an Android device, the splash screen shows and then never transitions to the tabs/screen....
Read more >Android App Stuck on Splash Screen only after first open ...
My app gets stuck on the Splash after the first boot only, only after it's downloaded from the Google Play Store.
Read more >App not starting , stuck on splashscreen
Turn off WiFi and data, then clear cache, then force stop, then open the app. Once the app is open and past the...
Read more >Android Stuck On Boot Screen and How To Fix It
Android phones might get stuck on the startup screen. The problem might be benign, and clear after a few minutes. However, it might...
Read more >Android Studio stucks on the splash screen after patching ...
1 Answer 1 · Uninstall all JDK and JRE · Remove all file in "C:\Program Files\Java" · Install the latest JDK (jdk1.8.0_66) ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hoi4 I can’t reproduce it now too. Don’t know what’s the trick. Anyway, thanks for your help.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.