Philzen / WebView-MultiTouch-Polyfill

A polyfill to gap missing multitouch functionality in HTML5 apps on Android 2.x
35 stars 9 forks source link

WMP & Construct 2 - Runtime error [Android 2.2.1] #24

Open slaczky opened 12 years ago

slaczky commented 12 years ago

I'm getting this Android runtime errors on Samsung Galaxy Mini:

10-18 14:17:39.243: W/dalvikvm(23557): threadid=1: thread exiting with uncaught exception (group=0x400207d8) 10-18 14:17:39.263: E/AndroidRuntime(23557): FATAL EXCEPTION: main 10-18 14:17:39.263: E/AndroidRuntime(23557): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sampleapp/com.sampleapp.SampleAppActivity}: java.lang.NullPointerException 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.app.ActivityThread.access$2300(ActivityThread.java:126) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.os.Handler.dispatchMessage(Handler.java:99) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.os.Looper.loop(Looper.java:123) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.app.ActivityThread.main(ActivityThread.java:4633) 10-18 14:17:39.263: E/AndroidRuntime(23557): at java.lang.reflect.Method.invokeNative(Native Method) 10-18 14:17:39.263: E/AndroidRuntime(23557): at java.lang.reflect.Method.invoke(Method.java:521) 10-18 14:17:39.263: E/AndroidRuntime(23557): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 10-18 14:17:39.263: E/AndroidRuntime(23557): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 10-18 14:17:39.263: E/AndroidRuntime(23557): at dalvik.system.NativeStart.main(Native Method) 10-18 14:17:39.263: E/AndroidRuntime(23557): Caused by: java.lang.NullPointerException 10-18 14:17:39.263: E/AndroidRuntime(23557): at com.changeit.wmpolyfill.WebClient.(WebClient.java:63) 10-18 14:17:39.263: E/AndroidRuntime(23557): at com.sampleapp.SampleAppActivity.onCreate(SampleAppActivity.java:25) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 10-18 14:17:39.263: E/AndroidRuntime(23557): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633) 10-18 14:17:39.263: E/AndroidRuntime(23557): ... 11 more

Am I doing something wrong, or wmp not suport Andorid 2.2.1 ?

Philzen commented 11 years ago

wmp v0.3 has been successfully tested on physical android 2.2 devices, just rechecked compatibility by running the emulators for 2.1 and 2.2.

@slaczky - The log states the error is caused by an empty WebView (it is null) being passed to the WebClient constructor. So your quick fix will be to ensure that whatever is initialised before and then and passed on line 25 in com.sampleapp.SampleAppActivity is a valid object of (base) type WebView.

Could you kindly elaborate on the app environment (other frameworks involved, MainActivity base class) - as i can see you added your phone to the Device Chart as working, but not for construct2... maybe you could post the code of the `onCreate() -Function from SampleAppActivity.java? Or even better - push the sample application to github, so i can try debugging that in context.