From issues-return-93741-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Thu Mar 29 12:52:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2A871180671 for ; Thu, 29 Mar 2018 12:52:05 +0200 (CEST) Received: (qmail 99827 invoked by uid 500); 29 Mar 2018 10:52:05 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 99648 invoked by uid 99); 29 Mar 2018 10:52:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2018 10:52:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A359B1A078B for ; Thu, 29 Mar 2018 10:52:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id RgHSlbdvhUhd for ; Thu, 29 Mar 2018 10:52:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id BA7425F173 for ; Thu, 29 Mar 2018 10:52:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E7C3AE0CCE for ; Thu, 29 Mar 2018 10:52:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 9C665255F1 for ; Thu, 29 Mar 2018 10:52:00 +0000 (UTC) Date: Thu, 29 Mar 2018 10:52:00 +0000 (UTC) From: "Andrew McMillan (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CB-13491) NullPointerException in Splash Screen on Android MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-13491?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D164187= 53#comment-16418753 ]=20 Andrew McMillan edited comment on CB-13491 at 3/29/18 10:51 AM: ---------------------------------------------------------------- I'm still seeing this on some phones, using version 5.0.2 of the plugin. Just looking at the code for line 225...227 of SplashScreen.java=C2=A0: {{if (fadeSplashScreenDuration > 0 && forceHideImmediately =3D=3D false) {}= } {{=C2=A0 =C2=A0 AlphaAnimation fadeOut =3D new AlphaAnimation(1, 0);}} {{=C2=A0 =C2=A0 fadeOut.setInterpolator(new DecelerateInterpolator());}} it seems pretty clear that creating the AlphaAnimation must be failing on s= ome devices (I'm seeing it on "Samsung Galaxy A5(2017) (a5y17lte), 3072MB R= AM, Android 7.0" according to the ANRs report on the Play Store) A reasonable fix would seem to be to move line 226 to before line 225 and c= heck for null in that give up on=C2=A0attempting to animate there, somethin= g like: {{AlphaAnimation fadeOut =3D new AlphaAnimation(1, 0);}} {{if (fadeOut !=3D null && fadeSplashScreenDuration > 0 && forceHideImmedi= ately =3D=3D false) {}} {{=C2=A0 =C2=A0 fadeOut.setInterpolator(new DecelerateInterpolator());}} =C2=A0 Or perhaps more pedantically: {{AlphaAnimation fadeOut =3D null;}} {{if (fadeSplashScreenDuration > 0 && forceHideImmediately =3D=3D false) f= adeOut =3D=C2=A0new AlphaAnimation(1, 0);}} {{if (fadeOut !=3D null) {}} {{=C2=A0 =C2=A0 fadeOut.setInterpolator(new DecelerateInterpolator());}} =C2=A0 was (Author: karora): I'm still seeing this on some phones, using version 5.0.2 of the plugin. Just looking at the code for line 225...227 of SplashScreen.java=C2=A0: {{if (fadeSplashScreenDuration > 0 && forceHideImmediately =3D=3D false) {}= } {{=C2=A0 =C2=A0 AlphaAnimation fadeOut =3D new AlphaAnimation(1, 0);}} {{=C2=A0 =C2=A0 fadeOut.setInterpolator(new DecelerateInterpolator());}} it seems pretty clear that creating the AlphaAnimation must be failing on s= ome devices (I'm seeing it on "Samsung Galaxy A5(2017) (a5y17lte), 3072MB R= AM, Android 7.0" according to the ANRs report on the Play Store) A reasonable fix would seem to be to move line 226 to before line 225 and c= heck for null in that give up on=C2=A0attempting to animate there, somethin= g like: {{AlphaAnimation fadeOut =3D new AlphaAnimation(1, 0);}} {{if (fadeOut !=3D null || (fadeSplashScreenDuration > 0 && forceHideImmed= iately =3D=3D false)) {}} {{=C2=A0 =C2=A0 fadeOut.setInterpolator(new DecelerateInterpolator());}} =C2=A0 Or perhaps more pedantically: {{AlphaAnimation fadeOut =3D null;}} {{if (fadeSplashScreenDuration > 0 && forceHideImmediately =3D=3D false) f= adeOut =3D=C2=A0new AlphaAnimation(1, 0);}} {{if (fadeOut !=3D null) {}} {{=C2=A0 =C2=A0 fadeOut.setInterpolator(new DecelerateInterpolator());}} =C2=A0 > NullPointerException in Splash Screen on Android > ------------------------------------------------ > > Key: CB-13491 > URL: https://issues.apache.org/jira/browse/CB-13491 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-plugin-splashscreen > Environment: Being reported on multiple devices including:=20 > Moto G4 Play > Galaxy S6=20 > LG K20 Plus > Galaxy S8+ > Samsung Galaxy On5 > LG K8 V > LG K20 plus > HTC ONE > LG Aristo > LG V20 > Slate 8 > LG X power > Motorola DROID Turbo > LG Stylo 2 > LG K7 > Moto E > Being reported on multiple versions including: > Android 7.1 > Android 7.0 > Android 6.0 > Android 5.1 > Reporter: Carey Pfaff > Priority: Critical > Labels: android, cordova-7.0.1, splashscreen > > Multiple crash logs are being reported with the error below. The app is u= sing cordova-plugin-splashscreen version 4.0.3. > java.lang.NullPointerException: > at org.apache.cordova.splashscreen.SplashScreen$4.run (SplashScreen.java:= 227) > at android.app.Activity.runOnUiThread (Activity.java:5874) > at org.apache.cordova.splashscreen.SplashScreen.removeSplashScreen (Splas= hScreen.java:217) > at org.apache.cordova.splashscreen.SplashScreen.onMessage (SplashScreen.j= ava:187) > at org.apache.cordova.PluginManager.postMessage (PluginManager.java:312) > at org.apache.cordova.CordovaWebViewImpl.postMessage (CordovaWebViewImpl.= java:377) > at org.apache.cordova.splashscreen.SplashScreen$2.run (SplashScreen.java:= 163) > at android.os.Handler.handleCallback (Handler.java:751) > at android.os.Handler.dispatchMessage (Handler.java:95) > at android.os.Looper.loop (Looper.java:154) > at android.app.ActivityThread.main (ActivityThread.java: 6165) > at java.lang.reflect.Method.invoke (Native Method) > at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit= .java:888) > at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:787) -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org