You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jenny Schubert (JIRA)" <ji...@apache.org> on 2017/06/21 09:42:00 UTC

[jira] [Commented] (CB-12277) Android, "SplashShowOnlyFirstTime"=true, crashes the app after re-opening it

    [ https://issues.apache.org/jira/browse/CB-12277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16057254#comment-16057254 ] 

Jenny Schubert commented on CB-12277:
-------------------------------------

I was able to reproduce this.
I had
<preference name="SplashShowOnlyFirstTime" value="false" />

Behavior to reproduce this (somewhat reliably) for me is the following:
Start the app
wait for the splashscreen to disappear
end the app somehow (i.e. with a button) with navigator.app.exitApp() - (1) see below
quickly start the app again (before Android can remove it from memory)
now the exception happens and crashes the app - (2)


(1): this apparently doesn't actually kill the app immediately, but only suspends it. 

(2): For some reason (1) means it is possible that in {color:#14892c}*line 219*{color} ({color:#59afe1}SplashScreen.java{color}), splashDialog is not null, while splashImageView ({color:#14892c}*Line 227*{color}) is null. My guess is that this happens in {color:#14892c}*line 316*{color}, where a new splashDialog Object is created, but the old splashImageView is added to it (which would be null).


> Android, "SplashShowOnlyFirstTime"=true, crashes the app after re-opening it
> ----------------------------------------------------------------------------
>
>                 Key: CB-12277
>                 URL: https://issues.apache.org/jira/browse/CB-12277
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Ionic
>    Affects Versions: 4.0.1
>         Environment: Windows 7 x64, engine Android 6, ionic CLI 2.1.17, ionic 2 RC4
>            Reporter: Musa Haidari
>              Labels: android, cannot-reproduce, triaged
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The app shows the splash screen on start. I want to close it programatically using this.platform.exitApp(); and after opening it again, I want the splash screen to apear again. The default behavoiur is to show the splash screen for the first run only, and if we close it the way mentioned, the subsequent openings will not show the splash screen.
> To override that  I used <preference name="SplashShowOnlyFirstTime" value="false" />. Using this, the app shows splash screen for the first time and when close the app as mentioned, and try opening it again, while it is still available in recent apps, the app crashes most of the times reporting this in ADB:
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime: FATAL EXCEPTION: main
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime: Process: com.mydomain.myapp, PID: 30375
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setAnimation(android.view.animation.Animation)' on a null object reference
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at org.apache.cordova.splashscreen.SplashScreen$4.run(SplashScreen.java:227)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at android.app.Activity.runOnUiThread(Activity.java:6050)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at org.apache.cordova.splashscreen.SplashScreen.removeSplashScreen(SplashScreen.java:217)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at org.apache.cordova.splashscreen.SplashScreen.access$1000(SplashScreen.java:49)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at org.apache.cordova.splashscreen.SplashScreen$5$1.run(SplashScreen.java:330)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7325)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
>     12-20 09:35:50.851 30375 30375 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org