java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol “__aeabi_memmove4” - android-ndk

When I run this example (https://github.com/alex011235/FaceSwap) I found this type of runtime error in Android Studio. I can select two images but when I click the button to swap the face, it crashed and the message show in logcat:
com.tzutalin.dlibtest E/AndroidRuntime: FATAL EXCEPTION: main Process: com.tzutalin.dlibtest, PID: 31370
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memmove4" referenced by "/data/app/com.tzutalin.dlibtest-2/lib/arm/libnativefaceswap.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.alex.faceswap.FaceSwap.(FaceSwap.java:57)
at com.alex.faceswap.ActivitySelfieSwap$1.run(ActivitySelfieSwap.java:168)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
The row that make me get error is the following row (FaceSwap.java:57).
System.loadLibrary("nativefaceswap");
I hope to get use of this example and I cannot solve this problem.

Related

Failure building Gradle

I tried to a create new project through Google maps activity but my android studio keeps through an exception whenever I try build the gradle. Please any solution colleagues. PC... haven't written any code yet.
Here is the gradle message ....
Error:error: resource android:attr/fontVariationSettings not found.
Error:error: resource android:attr/ttcIndex not found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

Why does my app crashes after without any error in my code? [duplicate]

This question already has answers here:
Didn't find class "androidx.core.app.CoreComponentFactory"
(16 answers)
Closed 1 year ago.
My app crashes instantly.
Ichecked my whole code everything seems right
I've tried:
Clean project
Invalidate caches /restart
rebuilding app
here is my log:
2019-09-24 17:11:22.287 24723-24723/com.example.splash E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[[zip file "/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:740)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:819)
at android.app.LoadedApk.getResources(LoadedApk.java:1041)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2360)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5985)
at android.app.ActivityThread.access$1200(ActivityThread.java:212)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1806)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6912)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/base.apk because: Bad encoded_array value: Failure to verify dex file '/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/base.apk': Bad encoded_value method type size 7
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:736)
... 12 more
2019-09-24 17:11:22.319 24723-24723/com.example.splash E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.splash, PID: 24723
java.lang.RuntimeException: Unable to instantiate application com.example.splash.FireApp: java.lang.ClassNotFoundException: Didn't find class "com.example.splash.FireApp" on path: DexPathList[[zip file "/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/lib/arm64, /system/lib64, /vendor/lib64]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1078)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6078)
at android.app.ActivityThread.access$1200(ActivityThread.java:212)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1806)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6912)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.splash.FireApp" on path: DexPathList[[zip file "/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:50)
at android.app.Instrumentation.newApplication(Instrumentation.java:1142)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1070)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6078) 
at android.app.ActivityThread.access$1200(ActivityThread.java:212) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1806) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6912) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860) 
Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/base.apk because: Bad encoded_array value: Failure to verify dex file '/data/app/com.example.splash-38vvy8h0ek5tJSz1HqPOZg==/base.apk': Bad encoded_value method type size 7
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:736)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:819)
at android.app.LoadedApk.getResources(LoadedApk.java:1041)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2360)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5985)
Bad Encode
Bad encoded_array value: Failure to verify dex file '/data/app/com.example.splash->38vvy8h0ek5tJSz1HqPOZg==/base.apk': Bad encoded_value method type size 7
reading the log you should check if there's an array that you are missing to fill or if there is an encode problem... have you seen if all your files are encoded correctly?
if you are passing this array from other activity you should check yf both documents have the same encoding type
Missing Class
com.example.splash.FireApp
You can check for this to be correctly called, or may be missing on you Manifest?
this part of you APK its called too much times on your log
-38vvy8h0ek5tJSz1HqPOZg==
you should check for that too.
Try to disable proguard and is if it helps. There is an issue with proguard and AndroidX

crashs on android L when load so

I have a skia shared library generated from skia source code, i want use it to draw something in my cpp file. This project runs well on android M and N, but it crashed on android L.
This is my CMakeList.txt
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_VERBOSE_MAKEFILE on)
set(libs "${CMAKE_SOURCE_DIR}/src/main/jniLibs")
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/android)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/atlastext)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/c)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/codec)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/config)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/core)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/effects)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/encode)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/gpu)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/pathops)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/ports)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/private)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/svg)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/utils)
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include/views)
#--------------------------------------------------- import ---------------------------------------------------#
add_library(libmyskia SHARED IMPORTED )
set_target_properties(libmyskia PROPERTIES
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libmyskia.so")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -fexceptions -fno-rtti")
add_library(eskia
SHARED
src/main/cpp/eskia.cpp )
find_library( android-lib
android)
target_link_libraries(eskia
libmyskia
${android-lib}
)
I load the library in my activity:
static {
System.loadLibrary("myskia");
System.loadLibrary("eskia");
}
Here is the crash info, has anyone meet this?
04-02 16:46:55.319 21449-21449/com.eastedu.skiaandroid E/art: dlopen("/data/app/com.eastedu.skiaandroid-2/lib/arm/libeskia.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZTVN10__cxxabiv117__class_type_infoE" referenced by "libeskia.so"...
04-02 16:46:55.319 21449-21449/com.eastedu.skiaandroid D/AndroidRuntime: Shutting down VM
04-02 16:46:55.319 21449-21449/com.eastedu.skiaandroid E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.eastedu.skiaandroid, PID: 21449
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZTVN10__cxxabiv117__class_type_infoE" referenced by "libeskia.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:383)
at java.lang.System.loadLibrary(System.java:997)
at com.eastedu.skiaandroid.MainActivity.<clinit>(MainActivity.java:17)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1606)
at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2535)
at android.app.ActivityThread.access$1200(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1387)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5689)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at enter code herecom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Android Studio: Error after deleting file

I got this error:
Error:Execution failed for task ':app:generateDebugBuildConfig'. > java.io.IOException: Could not delete path 'C:\Users\Guest Account\Documents\COLLEGE\FYP\7. Iteration 4\fridge iteration 4\app\build\generated\source\buildConfig\debug\com'.
and saw 'could not delete path' so I decided to follow the path and delete the path. When I reran the app I got seven new errors:
Error:Execution failed for task ':app:processDebugResources'.
Failed to execute aapt
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:failed linking file resources.
Error:attribute 'com.virtual.fridge:layout_behavior' not found.
Error:error: attribute 'com.virtual.fridge:layout_behavior' not found.
In my even log I have two new messages:
* daemon not running; starting now at tcp:5037
21:10 * daemon started successfully
I am going to presume this is down to deleting that file.. is there anything I can do? Really new to android studio so I appreciate any help. Please tell me what other information I shoudl provide
I cleaned the project and built it and it worked

My app is crashing whenever I am trying to open the app info in settings tab. It also looks like referring to the old package name

This is happening after I changed the package name. The app crashes only when I open "About"
This is the crash report
--------- beginning of crash
07-19 18:18:21.332 2739-2739/com.wallkeeper.reader E/AndroidRuntime:
FATAL EXCEPTION: main
Process: com.wallkeeper.reader, PID: 2739
java.lang.SecurityException: Permission Denial: starting Intent {
act=android.intent.action.VIEW
cmp=net.fred.feedex/.activity.AboutActivity } from
ProcessRecord{ca81fb2 2739:com.wallkeeper.reader/u0a64} (pid=2739,
uid=10064) not exported from uid 10063
at android.os.Parcel.readException(Parcel.java:1599)
at android.os.Parcel.readException(Parcel.java:1552)
at
android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2658)
at
android.app.Instrumentation.execStartActivity(Instrumentation.java:1507)
at android.app.Activity.startActivityForResult(Activity.java:3917)
at
android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
at
android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
at android.app.Activity.startActivityForResult(Activity.java:3877)
at
android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:871)
at android.app.Activity.startActivity(Activity.java:4200)
at android.app.Activity.startActivity(Activity.java:4168)
at android.preference.Preference.performClick(Preference.java:1012)
at
android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:214)
at android.widget.AdapterView.performItemClick(AdapterView.java:310)
at android.widget.AbsListView.performItemClick(AbsListView.java:1145)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3042)
at android.widget.AbsListView$3.run(AbsListView.java:3879)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Try adding android:exported="true" to your AndroidManifest.xml where your Activity is declared.
Also, double check that you are launching the correct configuration.

Resources