apache / cordova-android

Apache Cordova Android
https://cordova.apache.org/
Apache License 2.0
3.59k stars 1.52k forks source link

Cordova Android 12.0.1 app stucks on blank screen #1662

Closed gouteru closed 7 months ago

gouteru commented 7 months ago

Bug Report

Problem

My app get a blank screen after splash icon and seems freezed. Odd thing is action dialog displayed when I did "cordova run android" . (The action dialog says "Home Settings, Widget, Wall paper".) Please take a look at the attached mp4.

What is expected to happen?

The action dialog should not be displayed and app should start without blank screen.

Information

<?xml version='1.0' encoding='utf-8'?>
<!-- <widget id="com.app.myapp" version="1.7.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> -->
<widget id="com.app.myapp" version="5.0.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>myapp</name>
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#000000" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <preference name="StatusBarDefaultScrollToTop" value="false" />
    <preference name="loadUrlTimeoutValue" value="700000" />
    <preference name="cordova.plugins.diagnostic.modules" value="" />
    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="*" />
    <allow-intent href="http://*/*" launch-external="yes" />
    <allow-intent href="https://*/*" launch-external="yes" />
    <allow-intent href="*://*.google.com/*" />
    <allow-intent href="*://*.firebaseapp.com/*" />
    <allow-intent href="sms:*" launch-external="yes" />
    <allow-intent href="tel:*" launch-external="yes" />
    <allow-intent href="mailto:*" launch-external="yes" />
    <allow-intent href="geo:*" launch-external="yes" />
    <platform name="android">
        <preference name="android-compileSdkVersion" value="33" />
        <preference name="AndroidXEnabled" value="true" />
        <preference name="GradlePluginKotlinEnabled" value="true" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" />
        </edit-config>
        <resource-file src="res/android/drawable/ic_launcher_background.xml" target="app/src/main/res/drawable/ic_launcher_background.xml" />
        <resource-file src="res/android/drawable/ic_launcher_foreground.xml" target="app/src/main/res/drawable/ic_launcher_foreground.xml" />
        <resource-file src="res/android/mipmap-anydpi-v26/ic_launcher.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" />
        <resource-file src="res/android/mipmap-anydpi-v26/ic_launcher_round.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" />
        <resource-file src="res/android/mipmap-hdpi/ic_launcher.png" target="app/src/main/res/mipmap-hdpi/ic_launcher.png" />
        <resource-file src="res/android/mipmap-hdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_round.png" />
        <resource-file src="res/android/mipmap-mdpi/ic_launcher.png" target="app/src/main/res/mipmap-mdpi/ic_launcher.png" />
        <resource-file src="res/android/mipmap-mdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_round.png" />
        <resource-file src="res/android/mipmap-xhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher.png" />
        <resource-file src="res/android/mipmap-xhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_round.png" />
        <resource-file src="res/android/mipmap-xxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher.png" />
        <resource-file src="res/android/mipmap-xxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png" />
        <resource-file src="res/android/mipmap-xxxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" />
        <resource-file src="res/android/mipmap-xxxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png" />
        <preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/android/ic_launcher_splash.png" />
        <preference name="AndroidWindowSplashScreenBackground" value="#000000" />
        <allow-intent href="market:*" />
        <preference name="AndroidLaunchMode" value="singleTask" />
        <preference name="AndroidInsecureFileModeEnabled" value="true" />
        <preference name="AndroidPersistentFileLocation" value="Compatibility" />
        <preference name="AutoHideSplashScreen" value="true" />
        <preference name="SplashScreenDelay" value="3000" />
        <feature name="Calendar">
            <param name="android-package" value="nl.xservices.plugins.Calendar" />
        </feature>
        <!-- <preference name="GradlePluginGoogleServicesEnabled" value="true" />
        <preference name="GradlePluginGoogleServicesVersion" value="4.2.0" /> -->
        <custom-config-file parent="./application" target="AndroidManifest.xml">
            <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_notification" />
            <meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/colorAccent" />
        </custom-config-file>
        <config-file target="app/src/main/res/values/colors.xml" parent="/resources">
            <color name="background">#000000</color>
        </config-file>
        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
        </config-file>
        <preference name="AndroidPostSplashScreenTheme" value="@style/Theme.AppCompat.DayNight.NoActionBar" />
    </platform>
</widget>

Command or Code

Environment, Platform, Device

Pixel 7a (Android13) Xperia10 (Android11)

Version information

Cordova Android 12.0.1

Checklist

https://github.com/apache/cordova-android/assets/34151960/f6055a63-6e24-4647-b965-1e21452b44d1

breautek commented 7 months ago

Use the chrome web inspector to determine if there are any JS errors that is preventing your app from launching properly.

https://breautek.com/articles/debugging-cordova-apps.html

gouteru commented 7 months ago

Thanks, I have checked with Chrome inspector. I don't know why but there are wrong src path generated in index.html. Anyway, this is not Cordova issue. Sorry for bothering you.