
Right-click on the module you would like to link to your native library, such as the app module, and select Link C++ Project with Gradle from the menu. Import the eclipse project into Android Studio. I was looking to play with FastCV and ported the fastcorners example to Android Studio, you must add the headers and library from the SDK to your NDK build as mentioned previously in this post. Steps that I took for successfully porting FastCV example to Android Studion Define location with ndk.dir in the local.properties file or with an ANDROID_NDK_ROOT environment variable.")ĭef ndkbuild = getNdkDir() + "/ndk-build" Throw new GradleException("NDK location not found. Properties.load(('local.properties').newDataInputStream())ĭef ndkdir = properties.getProperty('ndk.dir', null) ProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' call regular ndk-build(.cmd) script from app directoryĬommandLine getNdkBuildCmd(), 'APP_PLATFORM=android-23'ĬompileTask -> pendsOn ndkBuild Jni.srcDirs = //disable automatic ndk-build call Some tweaks still need to be done in the Android.mk file(s) to point to your header and library file of the fastCV SDK and to get rid of some old flags not supported anymore by the latest NDK (e.g. The key point is to disable the automatic call to ndk-build using "jni.srcDirs = " I was able to compile the fastCV demo and run it on my Android device. It would be good to have a fastCV example running on Android Studio as this is the only official tool chain supported by Google for a while now. > .process.ProcessException: .ExecException: Process 'command '/home/frisacher/dev/android/ndk/ndk-build'' finished with non-zero exit value 2Īndroid Studio does not import correctly the JNI part and most of the changes need to be ported from the jni/Android.mk to adle Stop.Įrror:Execution failed for task ':app:compileDebugNdk'.
home/frisacher/dev/android/ndk/build/core/add-application.mkĮrror:(287) *** Android NDK: Aborting. I think that I was able to solve the static library dependency adding stl "fastcv" but build still failed This is the relevant NDK adle I use:ĬFlags "-I\$(TARGET_OUT_HEADERS)/fastcv -I/home/frisacher/dev/android/ndk/platforms/android-21/arch-arm64/usr/include -L/home/frisacher/dev/android/ndk/platforms/android-21/arch-arm64/usr/lib \$(OPENGLES_DEF) -Wl,-no-fix-cortex-a8 -Wno-write-strings" I am too trying to run the fastCV examples in Android Studio+gradle.