Telerik-Verified-Plugins / NativePageTransitions

Native transitions like Slide and Flip for iOS, Android and Windows Phone
277 stars 107 forks source link

Issue when returning from cordova BarcodeScanner #131

Closed felixwahner closed 8 years ago

felixwahner commented 8 years ago

When returning from a "camera view / barcodescanner" an exception is thrown and the devices view freezes. The app still responds to touch events (seen in the inspector) but the view on the device doesn't get updated.

This happens even if NativeTransitions are deactivated before switching the state.

This is the exception:

I/art     (19748): WaitForGcToComplete blocked for 7.470ms for cause HeapTrim
I/Camera2Client( 2980): disconnect(), Camera 0, calling PID: 19748, client PID: 19748, service PID: 2980
I/Camera2ClientBase( 2980): Closed Camera 0. Client was: de.xxx.app.yyy (PID 19748, UID 10100)
I/chromium(19748): [INFO:CONSOLE(15488)] "[native transition] enabling plugin", source: file:///android_asset/www/index.js?6ccf0f925323bc1ba577 (15488)
I/chromium(19748): [INFO:CONSOLE(15488)] "[native transition] disabling ionic transitions", source: file:///android_asset/www/index.js?6ccf0f925323bc1ba577 (15488)
I/chromium(19748): [INFO:CONSOLE(15488)] "[native transition] $stateChangeStart", source: file:///android_asset/www/index.js?6ccf0f925323bc1ba577 (15488)
I/chromium(19748): [INFO:CONSOLE(15488)] "[native transition]", source: file:///android_asset/www/index.js?6ccf0f925323bc1ba577 (15488)
E/AndroidRuntime(19748): FATAL EXCEPTION: main
E/AndroidRuntime(19748): Process: de.xxx.app.yyy, PID: 19748
E/AndroidRuntime(19748): java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
E/AndroidRuntime(19748):     at com.telerik.plugins.nativepagetransitions.NativePageTransitions$1.run(NativePageTransitions.java:151)
E/AndroidRuntime(19748):     at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(19748):     at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(19748):     at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(19748):     at android.app.ActivityThread.main(ActivityThread.java:5538)
E/AndroidRuntime(19748):     at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(19748):     at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(19748):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:958)
E/AndroidRuntime(19748):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:753)
I/Process (19748): Sending signal. PID: 19748 SIG: 9
I/HwSystemManager( 3402): HoldService:uid:10100 pid:19748 died
I/HwSystemManager( 3402): HoldService:oldVersionKey:10100,19748
I/MediaProcessHandler( 3231): processOp opType: 1, uid: 10100, pid: 19748
W/MediaProcessHandler( 3231): remove target not exist, maybe the UI process: uid: 10100, pid: 19748
EddyVerbruggen commented 8 years ago

Interesting issue - do you have a little app to reproduce this error? Or can you tell me which barcodescanner plugin and which version of this plugin you're using exactly.

claudiobianco commented 8 years ago

We have looked into it a bit more but unfortunately (for us) could not reproduce it with a small example app.

But here are some more infos:

Installed plugins:

com.telerik.plugins.nativepagetransitions 0.6.3 "Native Page Transitions"
cordova-plugin-crosswalk-webview 1.6.1 "Crosswalk WebView Engine"
cordova-plugin-fullscreen 1.1.0 "cordova-plugin-fullscreen"
cordova-plugin-splashscreen 3.1.0 "Splashscreen"
cordova-plugin-statusbar 2.1.2 "StatusBar"
cordova-plugin-whitelist 1.2.1 "Whitelist"
ionic-plugin-keyboard 2.0.1 "Keyboard"
phonegap-plugin-barcodescanner 4.1.0 "BarcodeScanner"
EddyVerbruggen commented 8 years ago

Thanks for those details. If the app crashes then you should be able to find the corresponding stacktrace in the Android devicelog. Can you plugin the device in via USB and run adb logcat? Then reproduce the crash and you should see a stacktrace in the console..

claudiobianco commented 8 years ago

Thats how we got the stacktrace in the first post. Do you need a longer extract?

EddyVerbruggen commented 8 years ago

I'm sorry didn't immediately realize you guys were work together on this. Are you able to make a change to NativePageTransitions.java in a local build for a quick test?

claudiobianco commented 8 years ago

Sorry, wasn't clear about that ;).

Sure

EddyVerbruggen commented 8 years ago

That comment "We use fixedPixelsTop > 0. If we set it to 0, it works fine." is interesting. Can you update the plugin from the master repo (or replace the latest NativePageTransitions.java with what you have now) and try again?

claudiobianco commented 8 years ago

Looks good at first glance. Thanks :).

Will test on monday a bit more, and will get back here again.

EddyVerbruggen commented 8 years ago

Sweet, have a good weekend!

claudiobianco commented 8 years ago

Seems to be working. Thanks again :)