简体   繁体   中英

opensense sdk pen example - HtcPaintingView ClassNotFoundException

HTC just released the OpenSense SDK: http://www.htcdev.com/devcenter/opensense-sdk

Can anybody run the Sense SDK pen examples? When I try to run them on my Ubuntu computer, the Flyer emulator opens and then the app crashes with this logcat exception:

08-09 21:33:50.949: ERROR/AndroidRuntime(463): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.htc.demo.penmenu/com.htc.demo.penmenu.MainActivity}: android.view.InflateException: Binary XML file line #55: Error inflating class com.htc.painting.engine.HtcPaintingView
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1748)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:1764)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.access$1500(ActivityThr ead.java:122)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1002)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.os.Handler.dispatchMessage(Handler.java:99 )
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.os.Looper.loop(Looper.java:132)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.main(ActivityThread.jav a:4025)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.reflect.Method.invoke(Method.java:491)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:841)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:599)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at dalvik.system.NativeStart.main(Native Method)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): Caused by: android.view.InflateException: Binary XML file line #55: Error inflating class com.htc.painting.engine.HtcPaintingView
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:682)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.rInflate(LayoutInflate r.java:724)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.rInflate(LayoutInflate r.java:727)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.inflate(LayoutInflater .java:479)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.inflate(LayoutInflater .java:391)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.inflate(LayoutInflater .java:347)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.android.internal.policy.impl.PhoneWindow.setCo ntentView(PhoneWindow.java:223)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.Activity.setContentView(Activity.java: 1780)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.htc.demo.penmenu.MainActivity.onCreate(MainAct ivity.java:42)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1048)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1712)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): ... 11 more
08-09 21:33:50.949: ERROR/AndroidRuntime(463): Caused by: java.lang.ClassNotFoundException: com.htc.painting.engine.HtcPaintingView in loader dalvik.system.PathClassLoader[/data/app/com.htc.demo.penmenu-2.apk]
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at dalvik.system.PathClassLoader.findClass(PathClassL oader.java:251)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 40)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 00)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.createView(LayoutInfla ter.java:542)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:671)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): ... 21 more

so it appears to be a ClassNotFoundException.

The only example I've successfully run is the compatibility demo.

Boo on HTC for releasing a half-baked "SDK".

The emulator for some reason doesn't work with opensense examples. I think it doesn't load Sense UI at all. If you take the apk of the example you are building (from the bin folder), and copy it into your sd memory, you can actually install, and run those examples directly on your phone. they work on your htc phone with SENSE. You won't get force close on the phone.

To run those examples on the emulator you should be able to boot a Sense Rom on it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM