Hello,
I'm trying to copy the ImageTarget-Project into my own.
The activity is registered in the manifest.xml and the compilation with ndk-build shows no error (after many tries and changes of the android.mk-file).
But if I try to open the ImageTarget-activity from my running program, it crashes and the adb logcat shows the following error:
I/ActivityManager( 149): Starting activity: Intent { cmp=com.qualcomm/.QCARSamp les.ImageTargets.ImageTargets } E/QCAR ( 3416): The library libQCAR.so could not be loaded E/QCAR ( 3416): The library libImageTargets.so could not be loaded D/QCAR ( 3416): QCARSampleActivity::onCreate I/global ( 3416): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. I/global ( 3416): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required. W/dalvikvm( 3416): No implementation found for native Lcom/qualcomm/QCARSamples/ ImageTargets/ImageTargets;.getOpenGlEsVersionNative ()I F/dalvikvm( 3416): Exception!!! threadid=1: thread exiting with uncaught excepti on (group=0x4001d7d8) E/AndroidRuntime( 3416): FATAL EXCEPTION: main E/AndroidRuntime( 3416): java.lang.UnsatisfiedLinkError: getOpenGlEsVersionNativ e E/AndroidRuntime( 3416): at com.qualcomm.QCARSamples.ImageTargets.ImageTa rgets.getOpenGlEsVersionNative(Native Method) E/AndroidRuntime( 3416): at com.qualcomm.QCARSamples.ImageTargets.ImageTa rgets.getInitializationFlags(ImageTargets.java:80) E/AndroidRuntime( 3416): at com.qualcomm.QCARSamples.Shared.QCARSampleAct ivity.onCreate(QCARSampleActivity.java:215) E/AndroidRuntime( 3416): at com.qualcomm.QCARSamples.ImageTargets.ImageTa rgets.onCreate(ImageTargets.java:51) E/AndroidRuntime( 3416): at android.app.Instrumentation.callActivityOnCre ate(Instrumentation.java:1047) E/AndroidRuntime( 3416): at android.app.ActivityThread.performLaunchActiv ity(ActivityThread.java:2627) E/AndroidRuntime( 3416): at android.app.ActivityThread.handleLaunchActivi ty(ActivityThread.java:2679) E/AndroidRuntime( 3416): at android.app.ActivityThread.access$2300(Activi tyThread.java:125) E/AndroidRuntime( 3416): at android.app.ActivityThread$H.handleMessage(Ac tivityThread.java:2033) E/AndroidRuntime( 3416): at android.os.Handler.dispatchMessage(Handler.ja va:99) E/AndroidRuntime( 3416): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 3416): at android.app.ActivityThread.main(ActivityThrea d.java:4627) E/AndroidRuntime( 3416): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 3416): at java.lang.reflect.Method.invoke(Method.java:5 21) E/AndroidRuntime( 3416): at com.android.internal.os.ZygoteInit$MethodAndA rgsCaller.run(ZygoteInit.java:876) E/AndroidRuntime( 3416): at com.android.internal.os.ZygoteInit.main(Zygot eInit.java:634) E/AndroidRuntime( 3416): at dalvik.system.NativeStart.main(Native Method)
In the Android.mk I put the following links:
LOCAL_C_INCLUDES := \ /cygdrive/c/Development/Android/qcar-sdk-0-9-7/build/include LOCAL_LDLIBS := \ -L/cygdrive/c/Development/Android/qcar-sdk-0-9-7/build/lib/$(TARGET_ARCH_ABI) \ -L/cygdrive/c/Development/Android/qcar-sdk-0-9-7/samples/Shared/libs/$(TARGET_ARCH_ABI) \ -llog -lQCAR -lShared \ $(OPENGLES_LIB)
Is there anything else, whereon I ahve to take care?
Regards, Kevin
These are the important errors:
E/QCAR ( 3416): The library libQCAR.so could not be loaded
E/QCAR ( 3416): The library libImageTargets.so could not be loaded
The libImageTargets.so file should be placed in the libs folder after running an ndk-build. Make sure you refresh your Eclipse project after running this command.
The libQCAR.so file is copied by a Builder in Eclipse. If you've moved your project folder, you will need to adjust the builder code accordingly. Look in the ImageTargets/.externalToolBuilders folder (hidden folder) and open the copyQCARLibs.bat (Windows) or copyQCARLibs.sh (Mac/Linux) file in a text editor. Adjust the paths there as well.
Let me know if you still have trouble!
- Kim