How to use HTC opensenseSDK?
I downloaded and test HTC opensense SDK . But I can't test any sample application . The main.xml file in the layout show like this
The following classes could not be found:
- com.htc.painting.engine.HTCPaintingView (Fix Build Path, Edit XML, Create Class)
- com.htc.painting.penmenu.PenMenu (Fix Build Path, Edit XML, Create Class)
How can I solve this problem ?
I see log cat error like this
10-04 12:02:05.001: ERROR/dalvikvm(580): Could not find class 'com.htc.painting.penmenu.PenMenu', referenced from method com.htc.demo.penmenu.MainActivity.init
10-04 12:02:05.510: ERROR/AndroidRuntime(580): FATAL EXCEPTION: main
10-04 12:02:05.510: ERROR/AndroidRuntime(580): 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
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.ActivityThread.performLaunchActi开发者_如何学Cvity(ActivityThread.java:1748)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1764)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.os.Handler.dispatchMessage(Handler.java:99)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.os.Looper.loop(Looper.java:132)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.ActivityThread.main(ActivityThread.java:4025)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at java.lang.reflect.Method.invokeNative(Native Method)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at java.lang.reflect.Method.invoke(Method.java:491)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at dalvik.system.NativeStart.main(Native Method)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): Caused by: android.view.InflateException: Binary XML file line #55: Error inflating class com.htc.painting.engine.HtcPaintingView
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:223)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.Activity.setContentView(Activity.java:1780)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at com.htc.demo.penmenu.MainActivity.onCreate(MainActivity.java:42)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1712)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): ... 11 more
10-04 12:02:05.510: ERROR/AndroidRuntime(580): Caused by: java.lang.ClassNotFoundException: com.htc.painting.engine.HtcPaintingView in loader dalvik.system.PathClassLoader[/data/app/com.htc.demo.penmenu-1.apk]
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.createView(LayoutInflater.java:542)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:671)
10-04 12:02:05.510: ERROR/AndroidRuntime(580): ... 21 more
I speak with a person from HTC,in samples only one example is working there will be update in few weeks and whole functions will be supported other
- Make sure to install HTC SKD properly as written on this page.
- When opening project from sample, make sure to check Build Target to HTC Tablet Extension
This problem is that main.xml references custom View, which is in this case in HTCExtension.jar archive, so you must have HTCExtension.jar on build path.
But I didn't have any problem opening sample project, everything was set up correctly and could be built. Try to reinstall whole SDK and open sample again.
精彩评论