0

Recently i have been working on a project using ARToolkit5 on android studio. Since i'm completely new to development using NDK, at first i thought of looking at the sample projects included with the artoolkit. The java based examples are working fine (ARSimpleProj & ARSimpleInteractionProj). But when i try to run the projects using native library (ARSimpleNativeProj & ARSimpleNativeCarsProj)the project is not working.

All I am getting is some error message in the logcat as shown below :

E/libARWrapper: ARController (native): [error]Loading single AR marker from >file 'Data/patt.hiro', width 80.000000. E/libARWrapper: ARController (native): [error]Error: unable to load single >AR marker from file 'Data/patt.hiro'. E/libARWrapper: ARController (native): [error]Error: Failed to load marker.

E/libARWrapper: ARController (native): [error]Loading single AR marker from >file 'Data/patt.kanji', width 80.000000. E/libar: Error opening pattern file 'Data/patt.kanji' for reading. E/libARWrapper: ARController (native): [error]Error: unable to load single >AR marker from file 'Data/patt.kanji'. E/libARWrapper: ARController (native): [error]Error: Failed to load marker.

And a continuous message in the logcat :

E/libARWrapper: ARController (native): [error]arwQueryMarkerTransformation(): Couldn't locate marker with UID -1.

I have tried a lot to find out what the problem is. I couldn't find a solution. Any help is appreciated.

I'm adding some more details of the logcat output hoping that it could provide some additional information

E/libARWrapper: ARController (native): VideoSource::configure(): video >Source video configuration: "-format=NV21" E/libARWrapper: ARController (native): VideoSource::configure(): video >Source camera parameters: "Data/camera_para.dat" E/libARWrapper: ARController (native): [error]Opening Android Video Source.

and

E/libARWrapper: ARController (native): ARController::startRunning(): called, >start running E/libARWrapper: ARController (native): [error]ARController::startRunning(): >Error: not initialized, exiting, returning false E/ARToolKit: Error starting video E/ARActivity: Error initialising camera. Cannot continue.

I'm encountering this message at the top of the logcat. I could'nt identify what is the cause for such an error

E/Zygote: Zygote:  error closing descriptor
libcore.io.ErrnoException: close failed: EBADF (Bad file number)
at libcore.io.Posix.close(Native Method)
at libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)
at                                         com.android.internal.os.ZygoteInit.closeServerSocket(ZygoteInit.java:221)
at com.android.internal.os.ZygoteConnection.handleChildProc(ZygoteConnection.java:879)
at com.android.internal.os.ZygoteConnection.runOnce(ZygoteConnection.java:242)
at com.android.internal.os.ZygoteInit.runSelectLoop(ZygoteInit.java:713)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:649)
at dalvik.system.NativeStart.main(Native Method)
Community
  • 1
  • 1

2 Answers2

0

First thing to do when working with Android Studio and ARToolKit is to run the build scripts located in ARTOOLKIT_ROOT/android both build.sh and build_native_examples.sh

Also a good starting point is the ARToolKit doku about that here: http://www.artoolkit.org/documentation/doku.php?id=4_Android:android_native

If you are on the GitHub version there is an update on the documentation just about to launch. As it is not published on ARToolKit.org jet I attached the PDF for you:

https://drive.google.com/file/d/0B0I5m7Yc2x-rZm5vcDBDOGo1Rm8/view?usp=sharing

Edit:

I just verified:

  • OS Ubuntu 14.04
  • Android Studio 1.5.1
  • ARToolKit from GitHub master branch
  • NDK 11 / Android SDK 6.0 / Java 1.7.0_79

Steps that worked for me:

  • execute ARTOOLKIT_ROOT/android/build.sh
  • execute ARTOOLKIT_ROOT/android/build_native_examples.sh
  • start AndroidStudio
  • Import Project -> ARNativeSimpleProj
  • Run on Nexus 5

That's it all is working well.

Thor_Bux
  • 1,137
  • 12
  • 26
0

try removing your application completely or deleting the app data. The app will cache your data from the Data folder so if you make any changes it wont' pick it up.

reidisaki
  • 1,525
  • 16
  • 29