eva_facial_mouse
eva_facial_mouse copied to clipboard
Unable to build EVA Facial Mouse on emulator
Hi,
I was trying to build EVA facial mouse, I have correct path set for OPENCVHOME, and have android dk and ndk path in local.properties file as well. But, even after that if I try to build, it fails at this step:
Android NDK: android-9 is unsupported. Using minimum supported version android-14.
Android NDK: WARNING: APP_PLATFORM android-14 is higher than android:minSdkVersion 1 in src/main/AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-14. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.
[armeabi] Install : libopencv_java.so => libs/armeabi/libopencv_java.so
[armeabi] Compile++ thumb: visionpipeline <= crvimage.cpp
[armeabi] Compile++ thumb: visionpipeline <= timeutil.cpp
[armeabi] Compile++ thumb: visionpipeline <= normroi2.cpp
[armeabi] Compile++ thumb: visionpipeline <= facedetection.cpp
[armeabi] Compile thumb : android_native_app_glue <= android_native_app_glue.c
[armeabi] StaticLibrary : libandroid_native_app_glue.a
[armeabi] SharedLibrary : libvisionpipeline.so
bundle/sources/android/native_app_glue/android_native_app_glue.c:233: error: undefined reference to 'android_main'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [src/main/obj/local/armeabi/libvisionpipeline.so] Error 1
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':eviacam:ndkBuild'.
> Process 'command '/Users/shreya/Library/Android/sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2
Any help would be appreciated. Thanks!
Did you follow instructions in INSTALL file?
Yes, I was following step by step the instructions in INSTALL.txt. My local.properties is as follows:
ndk.dir=/Users/shreya/Library/Android/sdk/ndk-bundle
sdk.dir=/Users/shreya/Library/Android/sdk
Did you install Android NDK version r13b+?
Yes i followed the install, but doesn't work I have the same error 😊
And i use the final version of ndk "16"
Please, try with NDK version r13b+ and let me know whether you still have issues.
i got the same error after using NDK version r13b+
Hi @rashedomar,
I also had some issues. I post my configuration so that you can compare with your own.
Android Studio: Android Studio 3.1 Build #AI-173.4670197, built on March 22, 2018 JRE: 1.8.0_152-release-1024-b01 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.12.6
The SDK and NDK version can be checked in /File/Project_Structure/SDK_Location
from Android Studio:
SDK: version 23 (Android 6.0). The SDK is installed with Android Studio.
Specified path: /Users/_username_/Library/Android/sdk
NDK: android-ndk-r13b (you can retrieve it directly from here: https://developer.android.com/ndk/downloads/older_releases.html)
Specified path: /Users/_username_/Library/Android/android-ndk-r13b
*android-ndk-r13b corresponds to the folder name once the file from the link above has been the downloaded and unzipped. Actually, you can put the folder whatever you want. In my case I just put it on the same directory as the rest of resources in order to keep things as organised as possible.
Finally, you have to configure the environment variable so that OpenCV can actually work. Take care special care with this step. Some time ago, I was retrieved with the ndk error due to the fact that this step was not correctly done.
If you use Windows you can set the environment variable depending on you OS version. Check this link: https://www.computerhope.com/issues/ch000549.htm.
If you use Mac, I highly recommend you this software: https://github.com/hschmidt/EnvPane. It is quite easy to use and it makes its function perfectly.
The environment variable must be called OPENCV_ANDROID_SDK
. Again, you have to download the software from https://sourceforge.net/projects/opencvlibrary/files/opencv-android/3.4.1/opencv-3.4.1-android-sdk.zip/download. Once you have downloaded the file, unzip it and set the environment variable to this value: /Users/_username_/Library/Android/OpenCV-android-sdk/sdk
. As I have said before, all resources in my case are associated with the same directory. What really matters here is the OpenCV-android-sdk/sdk
part. This article is also quite nice: https://opencv.org/platforms/android/.
I hope you can run the code correctly. Please, keep me updated with your advances. Kind regards, Pedro 😄
@pegomez I have follow all steps , that you told me to do . but nothing change , same problem .
The followed the instructions of the install file. Able to install the app on my device but it is crashing. Error: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.crea_si.eviacam.service/com.crea_si.eviacam.slavemode.SlaveModePreferencesActivity}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2016) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1673) at android.app.Activity.startActivityForResult(Activity.java:4688) at android.app.Activity.startActivityForResult(Activity.java:4646) at android.app.Activity.startActivity(Activity.java:5007) at android.app.Activity.startActivity(Activity.java:4975) at com.crea_si.eviacam.api.SlaveMode.openSettingsActivity(SlaveMode.java:270) at com.crea_si.eviacam.api_demo.MainActivity.onOptionsItemSelected(MainActivity.java:97)