Ionic app giving crash instantly while being opened

Asked

Viewed 128 times

0

I have an Ionic application that is stable and working in most of my clients.

However I have a client that has a Galaxy S9 and when you try to open the application, instantly appears:

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

By clicking "Send feedback", this is the log I have through google console:

java.lang.Runtimeexception:

at android.view.Displaylistcanvas.throwIfCannotDraw (Displaylistcanvas.java:229)

at android.view.Recordingcanvas.drawBitmap (Recordingcanvas.java:97)

at android.graphics.drawable.BitmapDrawable.draw (Bitmapdrawable.java:529)

at android.widget.Imageview.onDraw (Imageview.java:1367)

at android.view.View.draw (View.java:20338)

at android.view.View.updateDisplayListIfDirty (View.java:19283)

at android.view.View.draw (View.java:20061)

at android.view.Viewgroup.drawChild (Viewgroup.java:4421)

at android.view.Viewgroup.dispatchDraw (Viewgroup.java:4207)

at android.view.View.updateDisplayListIfDirty (View.java:19274)

at android.view.View.draw (View.java:20061)

at android.view.Viewgroup.drawChild (Viewgroup.java:4421)

at android.view.Viewgroup.dispatchDraw (Viewgroup.java:4207)

at android.view.View.updateDisplayListIfDirty (View.java:19274)

at android.view.View.draw (View.java:20061)

at android.view.Viewgroup.drawChild (Viewgroup.java:4421)

at android.view.Viewgroup.dispatchDraw (Viewgroup.java:4207)

at android.view.View.draw (View.java:20341)

at com.android.Internal.policy.Decorview.draw (Decorview.java:979)

at android.view.View.updateDisplayListIfDirty (View.java:19283)

at android.view.Threadedrenderer.updateViewTreeDisplayList (Threadedradder.java:686)

at android.view.Threadedraddressr.updateRootDisplayList (Threadedradder.java:692)

at android.view.Threadedrenderer.draw (Threadedrenderer.java:800)

at android.view.Viewrootimpl.draw (Viewrootimpl.java:3488)

at android.view.Viewrootimpl.performDraw (Viewrootimpl.java:3275)

at android.view.Viewrootimpl.performTraversals (Viewrootimpl.java:2810)

at android.view.Viewrootimpl.doTraversal (Viewrootimpl.java:1779)

at android.view.Viewrootimpl$Traversalrunnable.run (Viewrootimpl.java:7810)

at android.view.Choreographer$Callbackrecord.run (Choreographer.java:911)

at android.view.Choreographer.doCallbacks (Choreographer.java:723)

at android.view.Choreographer.doFrame (Choreographer.java:658)

at android.view.Choreographer$Framedisplayeventreceiver.run (Choreographer.java:897)

at android.os.Handler.handleCallback (Handler.java:789)

at android.os.Handler.dispatchMessage (Handler.java:98)

at android.os.Looper.loop (Looper.java:164)

at android.app.Activitythread.main (Activitythread.java:6938)

at java.lang.reflect.Method.invoke (Native Method)

at com.android.Internal.os.Zygote$Methodandargscaller.run (Zygote.java:327)

at com.android.Internal.os.Zygoteinit.main (Zygoteinit.java:1374)

My information

Ionic:

ionic (Ionic CLI) : 4.1.1 (C:\Users\jsoftwares1\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.11

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : not available
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 16 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Users\jsoftwares1\Desktop\tools\lib)
NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.0
OS : Windows 10

My plugins:

cordova-plugin-advanced-http 1.11.1 “Advanced HTTP plugin”
cordova-plugin-app-event 1.2.1 “Application Events”
cordova-plugin-app-version 0.1.9 “AppVersion”
cordova-plugin-background-mode 0.7.2 “BackgroundMode”
cordova-plugin-badge 0.8.7 “Badge”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-dialogs 2.0.1 “Notification”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-ionic-keyboard 2.1.2 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 1.2.1 “cordova-plugin-ionic-webview”
cordova-plugin-local-notification 0.9.0-beta.2 “LocalNotification”
cordova-plugin-local-notifications-db 0.8.4 “LocalNotification”
cordova-plugin-sim 1.3.3 “SIM”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-sqlite-storage 2.4.0 “Cordova sqlite storage plugin”
cordova-support-google-services 1.1.0 “cordova-support-google-services”
phonegap-plugin-multidex 1.0.0 “Multidex”
phonegap-plugin-push 2.2.3 “PushPlugin”

My config.xml:

<?xml version='1.0' encoding='utf-8'?>

    <widget id="japp.jcontrole" version="0.1.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

    <name>xApp</name>

    <description>Controle de perguntas/respostas auxiliar do sistema xx.</description>

    <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>

    <content src="index.html" />

    <allow-intent href="http://*/*" />

    <allow-intent href="https://*/*" />

    <content src="index.html" />

    <allow-navigation href="*" />

    <allow-intent href="*" />

    <access origin="*" subdomains="true" />

    <allow-intent href="tel:*" />

    <allow-intent href="sms:*" />

    <allow-intent href="mailto:*" />

    <allow-intent href="geo:*" />

    <preference name="ScrollEnabled" value="false" />

    <preference name="SplashScreenSpinnerColor" value="white" />

    <preference name="AndroidPersistentFileLocation" value="Compatibility" />

    <preference name="windows-target-version" value="10.0" />

    <preference name="windows-phone-target-version" value="10.0" />

    <preference name="android-minSdkVersion" value="19" />

    <preference name="BackupWebStorage" value="none" />

    <preference name="SplashMaintainAspectRatio" value="true" />

    <preference name="FadeSplashScreenDuration" value="300" />

    <preference name="SplashShowOnlyFirstTime" value="false" />

    <preference name="SplashScreen" value="screen" />

    <preference name="AutoHideSplashScreen" value="false" />

    <preference name="SplashScreenDelay" value="0" />

    <preference name="ShowSplashScreen" value="true" />

    <preference name="FadeSplashScreen" value="true" />

    <preference name="loadUrlTimeoutValue" value="700000" />

    <platform name="android">

    <icon qualifier="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />

    <icon qualifier="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />

    <icon qualifier="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />

    <icon qualifier="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />

    <icon qualifier="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />

    <icon qualifier="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />

    <splash qualifier="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />

    <splash qualifier="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />

    <splash qualifier="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />

    <splash qualifier="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />

    <splash qualifier="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />

    <splash qualifier="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />

    <splash qualifier="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />

    <splash qualifier="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />

    <splash qualifier="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />

    <splash qualifier="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />

    <splash qualifier="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />

    <splash qualifier="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />

    </platform>

    <platform name="ios">

    <icon height="57" platform="ios" src="resources/icons/ios/icon.png" width="57" />

    <icon height="114" platform="ios" src="resources/icons/ios/[email protected]" width="114" />

    <icon height="40" platform="ios" src="resources/icons/ios/icon-40.png" width="40" />

    <icon height="80" platform="ios" src="resources/icons/ios/[email protected]" width="80" />

    <icon height="50" platform="ios" src="resources/icons/ios/icon-50.png" width="50" />

    <icon height="100" platform="ios" src="resources/icons/ios/[email protected]" width="100" />

    <icon height="60" platform="ios" src="resources/icons/ios/icon-60.png" width="60" />

    <icon height="120" platform="ios" src="resources/icons/ios/[email protected]" width="120" />

    <icon height="180" platform="ios" src="resources/icons/ios/[email protected]" width="180" />

    <icon height="72" platform="ios" src="resources/icons/ios/icon-72.png" width="72" />

    <icon height="144" platform="ios" src="resources/icons/ios/[email protected]" width="144" />

    <icon height="76" platform="ios" src="resources/icons/ios/icon-76.png" width="76" />

    <icon height="152" platform="ios" src="resources/icons/ios/[email protected]" width="152" />

    <icon height="29" platform="ios" src="resources/icons/ios/icon-small.png" width="29" />

    <icon height="58" platform="ios" src="resources/icons/ios/[email protected]" width="58" />

    <icon height="87" platform="ios" src="resources/icons/ios/[email protected]" width="87" />

    <splash height="1136" platform="ios" src="resources/screens/ios/Default-568h@2x~iphone.png" width="640" />

    <splash height="1334" platform="ios" src="resources/screens/ios/Default-667h.png" width="750" />

    <splash height="2208" platform="ios" src="resources/screens/ios/Default-736h.png" width="1242" />

    <splash height="1242" platform="ios" src="resources/screens/ios/Default-Landscape-736h.png" width="2208" />

    <splash height="1536" platform="ios" src="resources/screens/ios/Default-Landscape@2x~ipad.png" width="2048" />

    <splash height="768" platform="ios" src="resources/screens/ios/Default-Landscape~ipad.png" width="1024" />

    <splash height="2048" platform="ios" src="resources/screens/ios/Default-Portrait@2x~ipad.png" width="1536" />

    <splash height="1024" platform="ios" src="resources/screens/ios/Default-Portrait~ipad.png" width="768" />

    <splash height="960" platform="ios" src="resources/screens/ios/Default@2x~iphone.png" width="640" />

    <splash height="480" platform="ios" src="resources/screens/ios/Default~iphone.png" width="320" />

    </platform>

    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />

    <plugin name="cordova-plugin-device" spec="2.0.2" />

    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />

    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />

    <allow-navigation href="http://192.168.0.15:8100" />

    <allow-navigation href="http://192.168.0.15:8101" />

    <allow-navigation href="http://192.168.0.15:8102" />

    <allow-navigation href="http://10.0.7.80:8100" />

    <plugin name="cordova-plugin-advanced-http" spec="^1.11.1" />

    <plugin name="cordova-plugin-ionic-webview" spec="^1.2.1" />

    <allow-navigation href="http://192.168.0.15:8103" />

    <allow-navigation href="http://192.168.0.15:8106" />

    <plugin name="cordova-sqlite-storage" spec="^2.3.3" />

    <plugin name="cordova-plugin-dialogs" spec="^2.0.1" />

    <plugin name="cordova-plugin-app-version" spec="^0.1.9" />

    <plugin name="cordova-plugin-sim" spec="^1.3.3" />

    <plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />

    <plugin name="phonegap-plugin-push" spec="^2.2.3">

    <variable name="ANDROID_SUPPORT_V13_VERSION" value="27.+" />

    <variable name="FCM_VERSION" value="11.6.2" />

    </plugin>

    <plugin name="cordova-plugin-background-mode" spec="^0.7.2" />

    <engine name="browser" spec="5.0.3" />

    <engine name="ios" spec="4.5.5" />

    <engine name="android" spec="7.1.0" />

    </widget>
    Recently i added a background mode with local notifications in one component:

     ngOnInit(): void {

      this.backgroundMode.setDefaults({silent:true});
      this.backgroundMode.enable();
      this.backgroundMode.on("activate").subscribe(()=>{

      this.backgroundMode.disableWebViewOptimizations()

      clearInterval(this.intervalId); 

      this.intervalId = setInterval(() => {this.consultaNotificacoes()}, 100000); 
    My function that call a local push notification:

     for (var i = 0; i < res.data.notificar.perguntas.length; i++) {
                this.localNotifications.schedule({
                  id: i+1,
                  priority: 2,
                  text: 'Produto: ' + res.data.notificar.perguntas[i].produto.substring(0, 20) + '...',
                  title: 'Nova pergunta, conta: ' + res.data.notificar.perguntas[i].conta,
                  smallIcon: 'res://notification',
                });
              }
            }
  • Already tried to compile it with the latest available android API?

  • How do you do this on Ionic? I compile using Ionic Cordova build android --release. In my config.xml the only thing that specifies about API is minSdkVersion, which is 19.

  • 1

    In fact, just log into Androidsdk and download the newest API

  • True, the problem was different, but I took advantage and already downloaded the new API

1 answer

1


I penetrated all afternoon and as incredible as it seems, the icones and splashs defined the way they were generated this crash.

Before was:

<platform name="android">
        <icon qualifier="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon qualifier="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon qualifier="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon qualifier="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon qualifier="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon qualifier="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash qualifier="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash qualifier="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash qualifier="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash qualifier="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash qualifier="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash qualifier="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash qualifier="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash qualifier="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash qualifier="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash qualifier="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash qualifier="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash qualifier="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>

I switched to:

<platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>

and it’s back up and running! :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.