Artoolkit source code file cannot execute successfully in Android Studio - android-studio

I downloaded the Artoolkit SDK in https://github.com/artoolkit/artoolkit5
And there is a directory called AndroidStudioProjects, which can be directly opened by using android studio.
I have configured all the jdk, android sdk, ndk.
However, those projects all have the error like this:
E/art: dlopen("/data/app/org.artoolkit.ar.samples.ARMovie-1/lib/arm/libARMovieNative.so", RTLD_LAZY) failed: dlopen failed: could not load library "libcurl.so" needed by "libARMovieNative.so"; caused by library "libcurl.so" not found
The main problem is could not load library "libcurl.so" needed by "libARMovieNative.so".
Can anyone help me please?

First you have to execute
$NDK/ndk-build
in the directory AndroidStudioProjects/ARMovieProj/aRMovie/src/main/jni/
which creates the libraries for a couple of architectures.
If you have not already done so far you have to execute the build.sh in the android directory of artoolkit.
If you don't want to build for every architecture feel free to modify
android/jni/Application.mk
ARMovieProj/aRMovie/src/main/jni/Application.mk
to for example
APP_ABI := armeabi-v7a
Make sure the arMovie.gradle has got the following inside the android block
android.sources.main.jniLibs {
source {
srcDirs = ['src/main/libs']
}
}

Related

Is it possible to port Flashdevelop project from Openfl to Android?

I made a neko project for Windows using FlashDevelop. I want to see if I can port it for android without remaking code or too much of it. In the past I was able to port to hmtl5 without having to remake code. Of course making an APK is different and requires getting some packages installed, I know that. The question is can I build android or I have to start a new project (like AS3) and go on in its own way?
I setup the
Path to Android SDK [C:\Programs\Android Development\platform-tools]: (contains adb, other files and the build-tools folder)
Path to Android NDK [C:\Programs\Android Development\android-ndk-r20]:
Path to Java JDK [C:\Programs\Android Development\jdk1.8.0_221]:
A simple project that displays an image. Errors I get when building 'android'
‘arm-linux-androideabi-g++’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not create PCH
Build halted with errors.
Or
in NativeCFFI.hx error: function body required
#:cffi private static function lime_jni_create_method(className:String, method:String, signature:String, isStatic:Bool, quiet:Bool):Dynamic;
‘arm-linux-androideabi-g++’ is not recognized as an internal or external command, operable program or batch file. Error: Could not create PCH Build halted with errors.
That error comes from an Android NDK that is too recent. Current HXCPP releases only support versions up to r15c, so I suggest you downgrade to that version.
Alternatively, you could try installing HXCPP from GitHub, as support for newer NDKs was recently merged.

Android NDK: No rule to make target with MuPDF

I am using this link, the answer by star18bit, to integrate MuPDF with my Android project.
I am able to run the ndk-build that is inside the MuPDF's android folder. But when I copied all MuPDF's files to my own project, and ran ndk-build from my project's jni folder, it gives this error:
make: *** No rule to make target ../jni/fitz/base_context.c', needed by ../jni/fitz/base_context.o'. Stop.
Any help to resolve this would be greatly appreciated!
I am following this link as it is, i.e., using the mupdf version 1.2 and android ndk r8e
I was trying to build this on MAC, but gave up.
Finally I did it on Windows 7, encountered a lot of issues while doing it. So I made a tutorial for it, for other users so that they don't have to go through the pain that I went through!
Here's the link:
http://howtojava.net/tutorials/android/integrate-mupdf-with-android-in-windows-7

Unsuccessful ndk build of my 2.6.7 Vuforia project in new Vuforia 3.0 SDK

I tried to run my ImageTargets 2.6.7 version in a new computer which runs new Vuforia SDK 3.0, android ndk 10 and all updated software according to Vuforia's Development Guide that I installed now, but I can't build successfully my C++ libraries, having the following error in Cygwin:
Android NDK: ERROR:jni/Android.mk:QCAR-prebuilt: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that jni/../../../build/lib/armeabi/libVuforia.so exists or that its path is correct
/cygdrive/c/Development/Android/android-ndk-r10c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
I updated all system paths in Environment variables, I made all alterations according to this link (https://developer.vuforia.com/resources/dev-guide/migrating-your-android-sdk-project) in my project, but the problem still remains.
What can I do please?
Your response is really important for me
Looks like the path of the libVuforia.so file is not correct. To eliminate the doubt - use a full path to the file (not ../../../). That can be configured in your jni/Android.mk file.

Android NDK UnsatisfiedLinkError: findLibrary returned null

Since two days, I get this error :
java.lang.UnsatisfiedLinkError: Couldn't load MyCPPProject from loader dalvik.system.PathClassLoader[dexPath=/system/framework/com.google.android.maps.jar:/data/app/com.mypackage.myApp-3.apk,libraryPath=/data/app-lib/com.mypackage.myApp-3]: findLibrary returned null
I'd like to compile a project c ++ natively in android application.
The project compiles fine on another PC but not on mine.
I tried to create a new workspace, install another eclipse and plenty others solutions but it still does not compile.
How can I fix it ?
The android project generate myApp.apk but not myApp-3.apk.
[dexPath=/system/framework/com.google.android.maps.jar:/data/app/com.mypackage.myApp-3.apk,libraryPath=/data/app-lib/com.mypackage.myApp-3]
Why compiler try to load myApp-3.apk ?
I fixed this issue by creating armeabi inside libs folder. And copied the .so files into armeabi folder.

Android NDK app won't run

I've been trying to get started on adding native code to my android app so I've looked through a plethora of Android NDK tutorials all to no avail. I can't get any of the apps to run on my emulator or my Galaxy S3. I keep getting the same error: "Unfortunately, [AppName] has stopped working"
My ndk-build command works successfully and I get a .so file. I don't know what the .so file is supposed to look like. Here's mine
http://txt.do/klo0
it looks like gibberish to me but what do I know?
This is my logcat
http://txt.do/klod
In the Android NDK directory, there is a hello-jni example. Try to compile and run it, it works.
It's in the samples/hello-jni directory of your NDK, I have it in ~/android-ndk-r9d/samples/hello-jni. Copy ("import") it into your workspace and compile.
To generate the headers:
cd bin/classes
javah com.my.package.name.MyClassName
Note that the library is usually placed by ndk-build into the libs/something subdirectory of your project, for example, libs/armeabi-v7a, and the file jni/Application.mk specifies what something is, e.g.
APP_ABI := armeabi-v7a
or
APP_ABI := all
The library will be placed in your apk and installed in a subdirectory of your application's data folder.
System.loadLibrary("stuff"); // libstuff.so
will find it. (Note that if you run your app as a system app, that's a different story.)
A library built for a wrong target will not work.

Resources