i m try to build ndk project in android studio but it will give me error like libopencv.so file not found.
yes I have included all the .so files Under jniLibs as instructed
and I am using the
Gradle 1.10
————————————————————
Build time: 2013-12-17 09:28:15 UTC
Build number: none
Revision: 36ced393628875ff15575fa03d16c1349ffe8bb6
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Android studio 0.5.3.
please let me know how can I resolve this.
In Android.mk, add
LOCAL_LDLIBS := $(LOCAL_PATH)/jniLibs/libopencv.so
Related
My task is defined inside app/build.gradle
rootProject.configurations has no configuration while configurations has everything e.g. "implementation", "testImplementation" etc.
Why?
------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------
Build time: 2019-04-26 08:14:42 UTC
Revision: 261d171646b36a6a28d5a19a69676cd098a4c19d
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_191 (Oracle Corporation 25.191-b12)
OS: Mac OS X 10.14.6 x86_64
The build.gradle file in the app folder defines a sub module (or sub project). The build.gradle file in the root folder defines the root project.
The configurations are added by plugins and in most use cases there is no need to apply a plugin in the root project.
I have following error when i try to build my game on android studio:
Error:(81) Android NDK: Application targets deprecated ABI(s): armeabi
Error:(82) Android NDK: Support for these ABIs will be removed in a future NDK release.
Run from command line works fine:
cocos run . -p android --android-studio
Go to Android.mk and change APP_ABI from armeabi to armeabi-v7a.
If you are using CMakeLists to build your project then go to gradle.properties and change to PROP_APP_ABI=armeabi-v7a if you want to add more architectures follow the instructions located in the gradle.properties file.
How can I build OpenCV for Android using Clang and the latest NDK r15b?
On the latest NDK r15b toolchains folder does not contain special subfolders with Clang except llvm and android.toolchain.cmake script ignores llvm subfolder. So I can't figure out how to make things work?
You can compile it like this:
cd $OPENCV_SRC_DIR
mkdir build
export ANDROID_NDK=$YOUR_NDK_PATH
cmake -DCMAKE_TOOLCHAIN_FILE=$YOUR_NDK_PATH/build/cmake/android.toolchain.cmake ..
make -j7
make install
cd install
NOTE:
Tested with the last ndk16 version + opencv-2.4.11.
(Clang is the default compiler in the new ndk's)
I'm Getting a error this error when i use ndk-build in pjsip example
Compile++ thumb : pjsua2 <= pjsua2_wrap.cpp
In file included from /Documents/softphones/trunk-pjproject/pjproject/pjsip-apps/src/swig/java/android/../output/pjsua2_wrap.cpp:160:0:
/Downloads/android-ndk-r8b//platforms/android-14/arch-arm/usr/include/jni.h:592:13: note: the mangling of 'va_list' has changed in GCC 4.4
/Documents/softphones/trunk-pjproject/pjproject/pjsip-apps/src/swig/java/android/../output/pjsua2_wrap.cpp: In constructor 'Swig::Director::JNIEnvWrapper::JNIEnvWrapper(const Swig::Director*)':
/Documents/softphones/trunk-pjproject/pjproject/pjsip-apps/src/swig/java/android/../output/pjsua2_wrap.cpp:335:73: error: invalid conversion from 'void**' to 'JNIEnv** {aka _JNIEnv**}' [-fpermissive]
/Downloads/android-ndk-r8b//platforms/android-14/arch-arm/usr/include/jni.h:1072:10: error: initializing argument 1 of 'jint _JavaVM::AttachCurrentThread(JNIEnv**, void*)' [-fpermissive]
make: *** [obj/local/armeabi/objs/pjsua2/__/output/pjsua2_wrap.o] Error 1
Any ideas how fix it ?
I'm using MacOs
swig -version
SWIG Version 3.0.7
Compiled with g++ [x86_64-apple-darwin14.5.0]
Configured options: +pcre
Thanks You!
I have compile issue with new Android NDK too. The way I solved is downgrade NDK version.
You can go to https://developer.android.com/ndk/downloads/older_releases.html and download Revision 13b (October 2016). Extract files to ~/Library/Android/sdk/ndk-bundle
And my SWIG version is 3.0.12 (I don't think this matters).
Hope this helps you.
I am new in Android studio & Gradle.
My project structure is like this:
MyProject
-LibModuleOne
-...
-build.gradle
-LibModuleTwo
- ...
-buld.gradle
-AppModule
-...
-build.gradle
buld.gradle
On command line, under MyProject/ , ./gradlew --version shows me that I am using gradle 2.1:
./gradlew --version
------------------------------------------------------------
Gradle 2.1
------------------------------------------------------------
Build time: 2014-09-08 10:40:39 UTC
Build number: none
Revision: e6cf70745ac11fa943e19294d19a2c527a669a53
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)
OS: Mac OS X 10.8.5 x86_64
But, if I check the version under MyProject/LibModuleOne/ or MyProject/LibModuleTwo/ or MyProject/AppModule/ they all show me that I am using gradle 1.12:
./gradlew --version
------------------------------------------------------------
Gradle 1.12
------------------------------------------------------------
Build time: 2014-04-29 09:24:31 UTC
Build number: none
Revision: a831fa866d46cbee94e61a09af15f9dd95987421
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
Ivy: 2.2.0
JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)
OS: Mac OS X 10.8.5 x86_64
The build.gradle of project root declares using Android plugin version0.13.3 :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.3'
}
}
In Android studio, File-->Project structure --> shows Gradle 2.1
Why gradle wrapper shows different version in sub-modules than project root ? How to make all my sub-modules use Gradle 2.1 ?
You appear to have multiple wrappers installed (otherwise ./gradlew wouldn't work from subdirectories). You need to remove all gradlew scripts and gradle/wrapper directories except for the ones in the root project's directory.