Log in or register to post comments

Building the ImageTarget Sample App

October 19, 2010 - 4:47am #1

Hello,

I'm having some trouble getting the sample app to work.

Here's what I'm running on
-------------------------
- WinXP
- Eclipse Galileo
- Nexus One w/ Android 2.2.1

First, here's what I did:
----------------------
1) installed all the perquisite software
2) ran the ndk-build process
3) create new projects for QCARSamples.shared and ImageTargets
a) there were some build path errors so I had to remove the relative link to the QCAR.jar file and add it as an external jar in both libraries.
b) had to add com_qualcomm_QCARSamples_Shared project in the build path for ImageTargets
c) add the qcar_icon to the appropriate res/drawable folder to clean up error in the Android Manifest

After step three and all of its substeps I had an errorless build of the two projects. When I try to deploy the app to the device and run it I get the following error in LogCat. Any thoughts on what I might be doing wrong?

10-19 07:36:25.399: ERROR/AndroidRuntime(16800): FATAL EXCEPTION: main
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.qualcomm.QCARSamples.ImageTargets/com.qualcomm.QCARSamples.ImageTargets.ImageTargets}: java.lang.ClassNotFoundException: com.qualcomm.QCARSamples.ImageTargets.ImageTargets in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARSamples.ImageTargets-2.apk]
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.os.Looper.loop(Looper.java:123)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at java.lang.reflect.Method.invokeNative(Native Method)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at java.lang.reflect.Method.invoke(Method.java:521)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at dalvik.system.NativeStart.main(Native Method)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): Caused by: java.lang.ClassNotFoundException: com.qualcomm.QCARSamples.ImageTargets.ImageTargets in loader dalvik.system.PathClassLoader[/data/app/com.qualcomm.QCARSamples.ImageTargets-2.apk]
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
10-19 07:36:25.399: ERROR/AndroidRuntime(16800): ... 11 more

Re: Building the ImageTarget Sample App

November 6, 2010 - 1:51pm #6

It looks like Eclipse is not detecting your device. Have you been able to run any of the Android sample applications on that device?

Make sure you have the latest version of the ADT (Android Developer Toolkit) installed in Eclipse. See the prior post in this thread for more information.

Also, make sure you have the latest USB drivers for your device. Can you access it as a storage device?

- Kim

Re: Building the ImageTarget Sample App

November 5, 2010 - 11:38am #5

hi people,
having some troubles as well setting up the sample app. i am running on a win7 64bit system connected with a htc desire hd. after doing step by step the getting started tutorial eclipse is saying at the end:

[2010-11-05 19:21:44 - ImageTargets] ------------------------------
[2010-11-05 19:21:44 - ImageTargets] Android Launch!
[2010-11-05 19:21:44 - ImageTargets] adb is running normally.
[2010-11-05 19:21:44 - ImageTargets] Performing com.qualcomm.QCARSamples.ImageTargets.ImageTargets activity launch
[2010-11-05 19:21:44 - ImageTargets] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2010-11-05 19:21:53 - ImageTargets] WARNING: Unknown device API version!
[2010-11-05 19:21:53 - ImageTargets] Uploading ImageTargets.apk onto device 'HT0AGRX00214'
[2010-11-05 19:21:54 - ImageTargets] Installing ImageTargets.apk...
[2010-11-05 19:21:57 - ImageTargets] Success!
[2010-11-05 19:21:57 - com_qualcomm_QCARSamples_Shared] Could not find com_qualcomm_QCARSamples_Shared.apk!
[2010-11-05 19:21:57 - ImageTargets] Starting activity com.qualcomm.QCARSamples.ImageTargets.ImageTargets on device HT0AGRX00214
[2010-11-05 19:21:57 - ImageTargets] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.qualcomm.QCARSamples.ImageTargets/.ImageTargets }

markus

Re: Building the ImageTarget Sample App

October 20, 2010 - 5:55am #4

To fix the QCAR.jar issue, make sure that you have properly set up the QCAR_SDK_ROOT workspace variable in Eclipse. See Step 2 > Set the QCAR Environment Variable in the Getting Started guide.

- Kim

Re: Building the ImageTarget Sample App

October 20, 2010 - 5:06am #3

Thank you Kim! That was exactly the problem.

Note to other people in my situation. It was necessary for me to start from scratch and rerun the ndk-build tool. I still needed to change the build path in both projects to point to the QCar.jar, but I no longer needed to add the shared project as a dependency as the "library" option does that for you.

Re: Building the ImageTarget Sample App

October 19, 2010 - 5:42am #2

I'm guessing you have an older version of ADT (Android Developer Toolkit) installed in Eclipse. Right-click on the com_qualcomm_QCARSamples_Shared project in the Package Explorer, and choose Android from the list on the left. Is there an "Is Library" checkbox available? If not, you need to upgrade the ADT. Go to Help > Check for Updates.

You will probably want to reset your project structure as outlined in the documentation for this to work.

- Kim

Log in or register to post comments