Wikitude / wikitude-cordova-plugin

Wikitude's Augmented Reality Plugin for Cordova - working together with the Wikitude SDK library for Android and iOS. Provides image recognition and tracking, geo-based augmente reality and 3D rendering and animations in an augmented reality scene
https://www.wikitude.com
Other
199 stars 182 forks source link

Android: Wikitude causing app crashes onPause #135

Open robwebdev opened 6 years ago

robwebdev commented 6 years ago

With version 8.0.0 of this plugin, sending the app to the background with the wikitude architect world loaded can cause my app to crash with the following stack trace:

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.skyjacker, PID: 4887
                  java.lang.NullPointerException: Attempt to invoke virtual method 'void com.wikitude.phonegap.WikitudePlugin$ArchitectViewPhoneGap.onPause()' on a null object reference
                      at com.wikitude.phonegap.WikitudePlugin$3.run(WikitudePlugin.java:316)
                      at android.os.Handler.handleCallback(Handler.java:739)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:152)
                      at android.app.ActivityThread.main(ActivityThread.java:5497)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
alexbendl commented 6 years ago

I was unable to reproduce this crash with the wikitude cordova example app. There is however a dangerous piece of code in the plugin that seems to be responsible for this crash. Could you add a snippet of how you use the plugin for us to understand how it was caused in your case?