OpenCV Android NDK: non-system libraries in linker error - android

This is the error I get, I followed different guides to install and run NDK but just couldn't manage it. Always a problem
20:58:58 **** Auto Build of configuration Default for project OpenCV Sample - face-detection ****
"C:\\Users\\Gok2\\workspace\\android-ndk-r9b\\ndk-build.cmd"
Android NDK: WARNING:jni/Android.mk:detection_based_tracker: non-system libraries in linker flags: -lopencv_java
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
[armeabi-v7a] Install : libdetection_based_tracker.so => libs/armeabi-v7a/libdetection_based_tracker.so

It's a warning, not an error. This warning has been introduced recently, in the latest release of NDK. The OpenCV build scripts have not yet accomodated the necessary workarounds, but I have no doubt the fix will be ready quite soon.
In the mean time, you can ignore the warning. I would advise to keep your eye on it, so that except for opencv libraries, no unexpected names appear in the build log.

Related

Build CommonCrypto from source?

My client is requesting I package CommonCrypto inside their app and not use the version supplied by the OS.
I haven't found any pre-built distributions, but I found the source code (sans build instructions). Is there a simple way to build from source?
I tried using ndk-build, but I see the following error:
Android NDK: ERROR:Android.mk:corecrypto: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /SWE/release/Software/Harissa/Updates/BuiltHarissa/Roots/corecrypto/prebuilts/armeabi-v7a/libcorecrypto.so exists or that its path is correct
/Users/rajohns/Library/Android/sdk/ndk/21.0.6113669/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
And as seen in the Android.mk file, the corecrypto module does in fact point to an unknown /SWE/release/Software/Harissa/Updates/BuiltHarissa/Roots/corecrypto directory.

Android ndk build ignoring APP_OPTIM and LOCAL_ARM_MODE

I have a project (in Android Studio 2.2.2) using the ffmpeg native library.
I have been able to build my project with no problems until recently.
Now I am getting the message:
Error: instruction not supported in Thumb16 mode -- `adds r2,r5,r4,lsr#31'
Error: selected processor does not support Thumb mode `itet ne'
I have set APP_OPTIM to debug in my Application.mk file and LOCAL_ARM_MODE to arm in my Android.mk file.
However, when I try to build my project, it is still showing these two error messages.
Please tell me if you need more information to help me solve this problem.
Thanks

ANDROID NDK ERROR with OPENCV

I am new to android programming. Certain situations lead me directly to a project with real time image processing. I am trying to use OPENCV library, but eclipse shows the following error:
18:15:30 **** Build of configuration Default for project OpenCV Sample - 15 puzzle ****
"E:\\AND_NDK\\android-ndk-r10d\\ndk-build.cmd" all
Android NDK: WARNING: APP_PLATFORM android-15 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Android NDK: LOCAL_MODULE definition in jni/Android.mk must not contain space
E:/AND_NDK/android-ndk-r10d/build/core/build-shared-library.mk:23: *** Android NDK: Please correct error. Aborting . Stop.
How could I solve this?
It seems you have spaces on jni/Android.mk, which seems to be incorrect. You should try removing those blank spaces.
You might want to take a look at the following question too: installing android OpenCV unable to locate error while building

i can't get opencv to work in android

I'm using eclipse to write android programs and i can successfully run them on adt but recently i had to write a program that uses opencv but i can't get opencv to work with android i got ndk and add it to system variables and also downloaded opencv4android sdk from this link: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html and i imported all the examples now i get numerous error for any of the examples and when i click project->clean->clean all it comes up with following error :
C:\Documentation_Android\android-ndk-r9d-windows-x86_64\android-ndk-r9d\ndk-build.cmd
Android NDK: WARNING:jni/Android.mk:mixed_sample: non-system libraries
in linker flags: -lopencv_java Android NDK: This is likely to
result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library
dependencies of the Android NDK: current module
[armeabi-v7a] Install : libmixed_sample.so =>
libs/armeabi-v7a/libmixed_sample.so
I also tried Fix Project Properties but nothing happened and i tried to change jni/Application.mk and change armeabi-v7a to armeabi and that didn't helped too what should i do now ? is there anything I missing here ?
have you added LOCAL_LDLIBS in android.mk file?
LOCAL_LDLIBS := $(LOCAL_PATH)/jniLibs/libmixed_sample.so //path of .so file
OK i found the answer ! How stupid I am ! i just have to go to opencv library project properties in android tab select project build target as android 4.2.2 and everything worked well

Android ndk-build command does nothing

I have a similar question to that posted here:
Android NDK: why ndk-build doesn't generate .so file and a new libs folder in Eclipse?
...though I am running Windows 7, not Mac os. Essentially the ndk-build command is run, gives no error but doesn't create an .so file (also, since I'm on windows this should create a .dll and not an .so?). I tried running the command from the root, jni, src folders etc. but got the same result; cmd just returns to the prompter after a few seconds. I ran it again from the jni folder with NDK_LOG=1 parameter to see what was happening. Here is a portion of the transcript of the log results after running ndk-build in the jni folder (after it successfully identified the platform, etc.)...
Android NDK: Looking for jni/Android.mk in /workspace/NdkFooActivity/jni
Android NDK: Looking for jni/Android.mk in /workspace/NdkFooActivity
Android NDK: Found it !
Android NDK: Found project path: /workspace/NdkFooActivity
Android NDK: Ouput path: /workspace/NdkFooActivity/obj
Android NDK: Parsing /cygdrive/c/android-ndk-r8/build/core/default-application.mk
Android NDK: Found APP_PLATFORM=android-15 in /workspace/NdkFooActivity/project.properties
Android NDK: Application local targets unknown platform 'android-15'
Android NDK: Switching to android-14
Android NDK: Using build script /workspace/NdkFooActivity/jni/Android.mk
Android NDK: Application 'local' is not debuggable
Android NDK: Selecting release optimization mode (app is not debuggable)
Android NDK: Adding import directory: /cygdrive/c/android-ndk-r8/sources
Android NDK: Building application 'local' for ABI 'armeabi'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.4.3' for 'armeabi' ABI
Android NDK: Looking for imported module with tag 'cxx-stl/system'
Android NDK: Probing /cygdrive/c/android-ndk-r8/sources/cxx-stl/system/Android.mk
Android NDK: Found in /cygdrive/c/android-ndk-r8/sources/cxx-stl/system
Android NDK: Cygwin dependency file conversion script:
...after which point it just runs the script mentioned in the last line, then terminates. Any ideas? Thanks!
Set up a builder. Refer to following article for how to do that:
http://maxters.net/2011/02/android-ndk-builder-for-eclipse-in-windows/
There is a "small" change beginning NDK r8 – Cygwin is not necessary anymore and I had a trouble when building native libraries with Cygwin and NDK r8 – there was some error message about cxx-stl...
Almost everything in the link above is OK, but leave Arguments in the Main tab blank and change Location to:
${env_var:ANDROID_NDK_ROOT}/ndk-build.cmd
I use system variable path ANDROID_NDK_ROOT, but you can provide a full path to the ndk-build.cmd.
Also, there is no need to set any variable in the Environment tab.
Set up your builder this way and you will be fine.
Just a note, Android is built on the top of the Linux OS, so even if you are on Windows you will get Linux libraries with .so extension.
Following link was instructive but missing a detail if you are configuring NDK support in Eclipse after CDT it already depricated (summer of 2017 already).
http://maxters.net/2011/02/android-ndk-builder-for-eclipse-in-windows/
Where you need to configure your external builder Location, instead of pointing to cygwin\bin\bash.exe and adding as Argument your ndk-build.cmd location this is what worked for me on Windows 7 and 10.
In "Edit Configuration" dialog for external builder do following:
- for Location -> specify where your "ndk-build.cmd" is. i.e "D:\Android\NDK\ndk-build.cmd"
- for Arguments -> just specify "all"
The NDK build system relies on wildcards to find the sources to compile. If you have a path wrong somewhere, it will find no sources and do nothing. Check Android.mk very carefully. More can't be said unless you post Android.mk and a description of the source tree.

Categories

Resources