bykim555 commented on issue #14844:
URL:
https://github.com/apache/incubator-mxnet/issues/14844#issuecomment-749504290
1. Tried to build Android_armv7 using ci/build.py and sucess. ndk17, api 24
2. Use Android Studio.
Android.mk,
include $(CLEAR_VARS)
LOCAL_MODULE := mxnet_inference
LOCAL_SRC_FILES := $(LOCAL_PATH)/libs/libmxnet.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/mxnet
include $(PREBUILT_SHARED_LIBRARY)
...
LOCAL_SHARED_LIBRARIES += mxnet_inference
include $(BUILD_SHARED_LIBRARY)
Application.mk
APP_ABI := armeabi-v7a
APP_PLATFORM := android-24
APP_STL := c++_static
NDK_TOOLCHAIN_VERSION := clang
APP_BUILD_SCRIPT := Android.mk
build.gradle
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.tistory.webnautes.useopencvwithndk_build"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// ndk {
// abiFilters "armeabi-v7a"
// }
}
buildTypes {
release {
minifyEnabled false
proguardFiles
getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
packagingOptions {
// pickFirst 'lib/arm64-v8a/*'
pickFirst 'lib/armeabi-v7a/*'
// pickFirst 'lib/x86/*'
// pickFirst 'lib/x86_64/*'
}
}
error showed as follows:
#==================
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tistory.webnautes.useopencvwithndk_build, PID: 12657
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol
"__aeabi_memcpy4" referenced by
"/data/app/com.tistory.webnautes.useopencvwithndk_build-2/lib/arm/libmxnet.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at
com.tistory.webnautes.useopencvwithndk_build.MainActivity.<clinit>(MainActivity.java:48)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1095)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3083)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
I/Process: Sending signal. PID: 12657 SIG: 9
#=======================================
How to fix that? Thank you.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]