We receive interesting native crash reports from our users. According to the log, the exception happens in the com.google.android.webview library when requesting theme attributes, specifically isAppUsingDarkTheme. The final method which fails is android::NativeApplyStyle(_JNIEnv*, _jclass*, long, long, int, int, long, _jintArray*, long, long).
According to user activity logs, there is a web content shown in the WebView before the crash. Here is the full stack of the issue.
backtrace:
#00 pc 000000000004e40c /apex/com.android.runtime/lib64/bionic/libc.so (abort+164)
#00 pc 000000000055d72c /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+2308)
#00 pc 0000000000013be4 /system/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76)
#00 pc 0000000000012fb4 /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+320)
#00 pc 0000000000120660 /system/lib64/libandroid_runtime.so (android::NativeApplyStyle(_JNIEnv*, _jclass*, long, long, int, int, long, _jintArray*, long, long)+348)
#00 pc 0000000000201e20 /system/framework/arm64/boot-framework.oat (art_jni_trampoline+240)
#00 pc 0000000000385368 /system/framework/arm64/boot-framework.oat (android.content.res.AssetManager.applyStyle+216)
#00 pc 000000000038f414 /system/framework/arm64/boot-framework.oat (android.content.res.ResourcesImpl$ThemeImpl.obtainStyledAttributes+244)
#00 pc 00000000003896f4 /system/framework/arm64/boot-framework.oat (android.content.res.Resources$Theme.obtainStyledAttributes+84)
#00 pc 00000000002b6224 /data/app/~~p8SKPpSzs5AfQaojVfFlHw==/com.google.android.webview-1wbeQSnfamx66qteIYrtdw==/oat/arm64/base.odex (kp.a+116)
#00 pc 00000000002de064 /data/app/~~p8SKPpSzs5AfQaojVfFlHw==/com.google.android.webview-1wbeQSnfamx66qteIYrtdw==/oat/arm64/base.odex (org.chromium.android_webview.AwDarkMode.isAppUsingDarkTheme+52)
#00 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548)
#00 pc 00000000001a8a78 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
#00 pc 00000000005556d0 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+468)
#00 pc 0000000000555870 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92)
#00 pc 00000000003a0d58 /apex/com.android.art/lib64/libart.so (art::JNI<false>::CallBooleanMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+660)
#00 pc 00000000044b14ec /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000)
#00 pc 0000000001bce710 /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000)
#00 pc 0000000001bce66c /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000)
#00 pc 0000000001bd9470 /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000) (Java_J_N_MrAp8rc4+5068)
#00 pc 000000000016f13c /data/app/~~p8SKPpSzs5AfQaojVfFlHw==/com.google.android.webview-1wbeQSnfamx66qteIYrtdw==/oat/arm64/base.odex (art_jni_trampoline+188)
#00 pc 00000000002e23a0 /data/app/~~p8SKPpSzs5AfQaojVfFlHw==/com.google.android.webview-1wbeQSnfamx66qteIYrtdw==/oat/arm64/base.odex (org.chromium.android_webview.AwSettings.populateWebPreferences+96)
#00 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548)
#00 pc 00000000001a8a78 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
#00 pc 00000000005556d0 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+468)
#00 pc 0000000000555870 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92)
#00 pc 00000000003abbbc /apex/com.android.art/lib64/libart.so (art::JNI<false>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+660)
#00 pc 0000000003b92d18 /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000)
#00 pc 0000000001bda1d4 /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000)
#00 pc 00000000043d54f4 /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000)
#00 pc 00000000023d0504 /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000)
#00 pc 0000000004b62074 /data/app/~~q2NFNMmXLCDOwTWYx91GOQ==/com.google.android.trichromelibrary_484408834-D4_y5yNsScUQXhSZirfHYg==/base.apk!libmonochrome_64.so (offset 0x6f8000) (Java_J_N_MGCvz8lp+64)
#00 pc 000000000016932c /data/app/~~p8SKPpSzs5AfQaojVfFlHw==/com.google.android.webview-1wbeQSnfamx66qteIYrtdw==/oat/arm64/base.odex (art_jni_trampoline+172)
#00 pc 000000000035fdf8 /data/app/~~p8SKPpSzs5AfQaojVfFlHw==/com.google.android.webview-1wbeQSnfamx66qteIYrtdw==/oat/arm64/base.odex (org.chromium.ui.events.devices.InputDeviceObserver.onInputDeviceAdded [DEDUPED]+40)
#00 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548)
#00 pc 00000000001a8a78 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
#00 pc 00000000003185c8 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376)
#00 pc 000000000030e8f4 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996)
#00 pc 000000000067e650 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1032)
#00 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20)
#00 pc 00000000004d0bf8 /system/framework/framework.jar (android.hardware.input.InputManager$InputDeviceListenerDelegate.handleMessage+32)
#00 pc 0000000000305ef0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7972480776628613073)+268)
#00 pc 000000000066b988 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780)
#00 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88)
#00 pc 000000000064fd64 /system/framework/arm64/boot-framework.oat (android.os.Handler.dispatchMessage+180)
#00 pc 00000000006532c4 /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+1668)
#00 pc 000000000040de40 /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.main+752)
#00 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568)
#00 pc 00000000001a8a94 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228)
#00 pc 0000000000555df0 /apex/com.android.art/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1364)
#00 pc 00000000004d5538 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52)
#00 pc 000000000008a6f4 /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+180)
#00 pc 00000000008d0968 /system/framework/arm64/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136)
#00 pc 00000000008d912c /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2444)
#00 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568)
#00 pc 00000000001a8a94 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228)
#00 pc 000000000055482c /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+448)
#00 pc 0000000000554ce0 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92)
#00 pc 0000000000438e64 /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+656)
#00 pc 000000000009b424 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+124)
#00 pc 00000000000a34e8 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+836)
#00 pc 0000000000003674 /system/bin/app_process64 (main+1580)
#00 pc 00000000000499e4 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108)
And here is the code of the NativeApplyStyle, where the crash happens.
static void NativeApplyStyle(JNIEnv* env, jclass /*clazz*/, jlong ptr, jlong theme_ptr,
jint def_style_attr, jint def_style_resid, jlong xml_parser_ptr,
jintArray java_attrs, jlong out_values_ptr, jlong out_indices_ptr) {
ScopedLock<AssetManager2> assetmanager(AssetManagerFromLong(ptr));
Theme* theme = reinterpret_cast<Theme*>(theme_ptr);
CHECK(theme->GetAssetManager() == &(*assetmanager));
(void) assetmanager;
ResXMLParser* xml_parser = reinterpret_cast<ResXMLParser*>(xml_parser_ptr);
uint32_t* out_values = reinterpret_cast<uint32_t*>(out_values_ptr);
uint32_t* out_indices = reinterpret_cast<uint32_t*>(out_indices_ptr);
jsize attrs_len = env->GetArrayLength(java_attrs);
jint* attrs = reinterpret_cast<jint*>(env->GetPrimitiveArrayCritical(java_attrs, nullptr));
if (attrs == nullptr) {
return;
}
ApplyStyle(theme, xml_parser, static_cast<uint32_t>(def_style_attr),
static_cast<uint32_t>(def_style_resid), reinterpret_cast<uint32_t*>(attrs), attrs_len,
out_values, out_indices);
env->ReleasePrimitiveArrayCritical(java_attrs, attrs, JNI_ABORT);
}
Any thoughts?
Found similar bug posted here https://issuetracker.google.com/issues/225213329
Related
I tried to do some periodic action in Android R automotive device by ScheduledThreadPoolExecutor.
There is my code:
private static class NamedThreadFactory implements ThreadFactory {
private final AtomicInteger mThreadNumber = new AtomicInteger(1);
private final String mNamePrefix;
NamedThreadFactory(String namePrefix) {
mNamePrefix = namePrefix + "-thread-";
}
#Override
public Thread newThread(Runnable r) {
final Thread thread = new Thread(r, mNamePrefix + mThreadNumber.getAndIncrement());
return thread;
}
}
private ScheduledThreadPoolExecutor mPopDataRefreshExecutor =
new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("refreshPopData"));
mPopDataRefreshExecutor.scheduleAtFixedRate(new PopDataRefresher(),
TimeUnit.MINUTES.toMillis(5),
TimeUnit.MINUTES.toMillis(10),
TimeUnit.MILLISECONDS);
And then, it once raise some native signal 6 exception:
Revision: '0'
ABI: 'arm'
Timestamp: 1912-01-03 13:32:13+0800
pid: 9441, tid: 11146, name: RefreshPopData- >>> com.demo <<<
uid: 1010065
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'Failed to park: Invalid argument'
r0 00000000 r1 00002b8a r2 00000006 r3 bb98eb00
r4 bb98eb14 r5 bb98eaf8 r6 000024e1 r7 0000016b
r8 bb98eb10 r9 bb98eb00 r10 bb98eb30 r11 bb98eb20
ip 00002b8a sp bb98ead0 lr f1fa158f pc f1fa15a2
backtrace:
#00 pc 000545a2 /apex/com.android.runtime/lib/bionic/libc.so (abort+166) (BuildId: ced36bae419d8d9438cf6f91c6feea37)
#01 pc 003a0f7d /apex/com.android.runtime/lib/libart.so (art::Runtime::Abort(char const*)+1980) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#02 pc 000085e1 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+488) (BuildId: d8f9959168f480e25050a2b6cf313736)
#03 pc 003cff97 /apex/com.android.runtime/lib/libart.so (art::Thread::Park(bool, long long)+1570) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#04 pc 003417e9 /apex/com.android.runtime/lib/libart.so (art::Unsafe_park(_JNIEnv*, _jobject*, unsigned char, long long)+440) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#05 pc 000edfc9 /system/framework/arm/boot.oat (art_jni_trampoline+96) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#06 pc 0024e283 /system/framework/arm/boot.oat (java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos+818) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#07 pc 003914f7 /system/framework/arm/boot.oat (java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take+326) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#08 pc 003600dd /system/framework/arm/boot.oat (sun.nio.fs.UnixPath.getParent [DEDUPED]+36) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#09 pc 0034b265 /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor.getTask+428) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#10 pc 0034c9ff /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+222) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#11 pc 0034a0a7 /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+54) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#12 pc 001da039 /system/framework/arm/boot.oat (java.lang.Thread.run+64) (BuildId: 16090464612e7610f7b849552ef4a978eef87738)
#13 pc 000e4bc5 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#14 pc 0045e97b /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+250) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#15 pc 000ecffd /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+160) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#16 pc 0039ab77 /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+54) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#17 pc 0039b881 /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+300) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#18 pc 003d0e73 /apex/com.android.runtime/lib/libart.so (art::Thread::CreateCallback(void*)+982) (BuildId: b1931727e2af1deddf3d63be01bc9e06)
#19 pc 0009c5e7 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: ced36bae419d8d9438cf6f91c6feea37)
#20 pc 00055a97 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: ced36bae419d8d9438cf6f91c6feea37)
When I tried to add some log to solve this problem, it never happends again with same apk and same device.
Is any advice to deal with it, I tried to read AOSP code(https://cs.android.com/android/platform/superproject/+/master:art/runtime/thread.cc;l=311?q=Thread::park) and find out this stack mean to futex something failed. But I have no idea what "Failed to park: Invalid argument" means.
Google Play has reported a large number of the following crashes from a few devices. I want to emphasize it is a very small number of devices (fewer than 0.01% of devices running the app):
signal 7 (SIGBUS), code 2 (BUS_ADRERR)
art::ElfFile::Open(unix_file::FdFile*, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, unsigned char*)
backtrace:
#00 pc 0000000000140c58 /system/lib/libart.so (art::ElfFile::Open(unix_file::FdFile*, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, unsigned char*)+160)
#00 pc 000000000030c445 /system/lib/libart.so (art::ElfOatFile::ElfFileOpen(unix_file::FdFile*, unsigned char*, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+64)
#00 pc 000000000030c6ab /system/lib/libart.so (art::ElfOatFile::Load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned char*, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+98)
#00 pc 000000000030ca23 /system/lib/libart.so (art::OatFile::Open(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned char*, unsigned char*, bool, bool, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+418)
#00 pc 000000000031257b /system/lib/libart.so (art::OatFileAssistant::OatFileInfo::GetFile()+454)
#00 pc 0000000000310bdd /system/lib/libart.so (art::OatFileAssistant::OatFileInfo::Status()+36)
#00 pc 0000000000310b8f /system/lib/libart.so (art::OatFileAssistant::IsUpToDate()+58)
#00 pc 00000000003169e3 /system/lib/libart.so (art::OatFileManager::OpenDexFilesFromOat(char const*, _jobject*, _jobjectArray*, art::OatFile const**, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>*)+246)
#00 pc 00000000002e3349 /system/lib/libart.so (art::DexFile_openDexFileNative(_JNIEnv*, _jclass*, _jstring*, _jstring*, int, _jobject*, _jobjectArray*)+100)
#00 pc 0000000000076793 /system/framework/arm/boot-core-libart.oat (offset 0x76000) (dalvik.system.DexFile.openDexFileNative+194)
#00 pc 00000000000ea1eb /system/framework/arm/boot-core-libart.oat (offset 0x76000) (dalvik.system.DexFile.openDexFile+186)
#00 pc 00000000000eb851 /system/framework/arm/boot-core-libart.oat (offset 0x76000) (dalvik.system.DexPathList.makeDexElements+560)
#00 pc 00000000000eb3b5 /system/framework/arm/boot-core-libart.oat (offset 0x76000) (dalvik.system.DexPathList.<init>+516)
#00 pc 0000000000149eaf /system/framework/arm/boot-core-libart.oat (offset 0x76000) (dalvik.system.PathClassLoader.<init>+110)
#00 pc 0000000000a05dc9 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (com.android.internal.os.ClassLoaderFactory.createClassLoader+568)
#00 pc 0000000000a05e33 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (com.android.internal.os.ClassLoaderFactory.createClassLoader+58)
#00 pc 0000000000676a97 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.ApplicationLoaders.getClassLoader+278)
#00 pc 0000000000676d35 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.ApplicationLoaders.getClassLoader+84)
#00 pc 000000000067ed67 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.LoadedApk.createOrUpdateClassLoaderLocked+2110)
#00 pc 000000000068123d /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.LoadedApk.getClassLoader+76)
#00 pc 00000000006815e1 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.LoadedApk.getResources+320)
#00 pc 0000000000771e0d /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.ContextImpl.createAppContext+140)
#00 pc 000000000075baf3 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.ActivityThread.handleBindApplication+4434)
#00 pc 00000000007582fd /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.ActivityThread$H.handleMessage+5788)
#00 pc 00000000009107d1 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.os.Handler.dispatchMessage+136)
#00 pc 0000000000912ecb /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.os.Looper.loop+1162)
#00 pc 000000000076157b /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.app.ActivityThread.main+674)
#00 pc 0000000000418375 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
#00 pc 00000000003f1a5b /system/lib/libart.so (art_quick_invoke_static_stub+222)
#00 pc 00000000000a1043 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
#00 pc 00000000003510dd /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
#00 pc 0000000000352525 /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+960)
#00 pc 0000000000303249 /system/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+40)
#00 pc 00000000001121ff /system/framework/arm/boot.oat (offset 0x10c000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)
#00 pc 0000000000a0cd93 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+114)
#00 pc 0000000000a12d19 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (com.android.internal.os.ZygoteInit.main+2896)
#00 pc 0000000000418375 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
#00 pc 00000000003f1a5b /system/lib/libart.so (art_quick_invoke_static_stub+222)
#00 pc 00000000000a1043 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
#00 pc 00000000003510dd /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
#00 pc 0000000000350ef9 /system/lib/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+304)
#00 pc 00000000002949cd /system/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+476)
#00 pc 000000000006cd03 /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+38)
#00 pc 000000000006ef2b /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+462)
#00 pc 000000000000198d /system/bin/app_process32 (main+724)
#00 pc 0000000000088f55 /system/lib/libc.so (__libc_init+48)
#00 pc 0000000000001677 /system/bin/app_process32 (_start_main+46)
#00 pc 0000000000017fa7 /system/bin/linker (__dl__ZN6soinfoD1Ev+14)
#00 pc 00000000007feb99 [stack:ff55c000]
The backtrace does not indicate any code of the app. Could anyone offer a clue about the cause of this crash?
The above crash is from Xiaomi MiBox SAndroid 9 (SDK 28).
The app targets API 31
I have an application that is using the camera to read a QR code.
I am using Android Studio.
I have configured the emulator to use the camera of the Mac.
It used to work before and I can't figure out why it doesn't work anymore.
Any help would be greatly appreciated.
Thanks.
Here are the dependencies of my app:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
qr_code_scanner: ^0.5.2
google_mobile_ads: ^0.13.0
receive_sharing_intent: ^1.4.5
This is the code that tries to open the camera and read the QR code:
void _scanQrCode(BuildContext context) {
late String url;
showDialog(
context: context,
builder: (BuildContext context) {
return QRCodeScanner(
(String qrCodeUrl) {
url = qrCodeUrl;
Navigator.of(context).pop();
playBingo(url);
},
);
});
}
Here's the log of the error:
I/CenterCropStrategy(15154): Preview: 960x1280; Scaled: 1186x1582; Want: 1080x1582
I/CameraPreview(15154): Starting preview
D/CameraInstance(15154): Starting preview
I/AutoFocusManager(15154): Current focus mode 'fixed'; use auto focus? false
E/libEGL (15154): call to OpenGL ES API with no current context (logged once per thread)
E/mypackage.myapp(15154): [SurfaceTexture-0-15154-0] attachToContext: invalid current EGLDisplay
E/flutter (15154): [ERROR:flutter/fml/platform/android/jni_util.cc(182)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
E/flutter (15154): at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:295)
E/flutter (15154): at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:55)
E/flutter (15154): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (15154): at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter (15154): at android.os.Looper.loop(Looper.java:183)
E/flutter (15154): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/flutter (15154): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (15154): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/flutter (15154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/flutter (15154):
F/flutter (15154): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1231)] Check failed: fml::jni::CheckException(env).
I/mypackage.myapp(15154): NativeAlloc concurrent copying GC freed 83987(5657KB) AllocSpace objects, 24(936KB) LOS objects, 49% free, 4472KB/8944KB, paused 47us total 100.465ms
F/crashpad(15427): dlopen: dlopen failed: library "libandroidicu.so" not found: needed by /system/lib/libharfbuzz_ng.so in namespace (default)
F/libc (15154): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 15154 (mypackage.myapp), pid 15154 (mypackage.myapp)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_x86/generic_x86_arm:11/RSR1.201013.001/6903271:user/release-keys'
Revision: '0'
ABI: 'x86'
Timestamp: 2021-10-17 08:57:45+0200
pid: 15154, tid: 15154, name: mypackage.myapp >>> com.mypackage.myapp <<<
uid: 10155
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1231)] Check failed: fml::jni::CheckException(env).
'
eax 00000000 ebx 00003b32 ecx 00003b32 edx 00000006
edi e48b081e esi ffdd2830
ebp e9ef6b90 esp ffdd27d8 eip e9ef6b99
backtrace:
#00 pc 00000b99 [vdso] (__kernel_vsyscall+9)
#01 pc 0005ad68 /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
#02 pc 00076511 /apex/com.android.runtime/lib/bionic/libc.so (abort+209) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
#03 pc 01375aca /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#04 pc 013ae8fb /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#05 pc 01381c65 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#06 pc 0137434a /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#07 pc 0137414f /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#08 pc 013a6bc3 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#09 pc 013a37e6 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#10 pc 013a6f33 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#11 pc 013a37e6 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#12 pc 013a5c84 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#13 pc 013a37e6 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#14 pc 013a6f33 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#15 pc 013a37e6 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#16 pc 013a6f33 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#17 pc 013a37e6 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#18 pc 013a6f33 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#19 pc 013a37e6 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#20 pc 013a3795 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#21 pc 013a4a79 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#22 pc 01395ca7 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#23 pc 013fc167 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#24 pc 013fcf8d /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#25 pc 013fde5c /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#26 pc 013a8cbd /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#27 pc 013fc7a4 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#28 pc 013fc433 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#29 pc 0140c4e4 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#30 pc 013ac89b /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#31 pc 013afabf /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#32 pc 013af9d0 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#33 pc 013b6d02 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#34 pc 013b6d30 /data/app/~~FljEifuq7NDS0O7fhY6Ofw==/com.mypackage.myapp-CzyBbSiT7dKO4fvfFbhfbQ==/lib/x86/libflutter.so (BuildId: 5ed38fd537848ce662aaf4326fd6bc527ef1386c)
#35 pc 00019337 /system/lib/libutils.so (android::SimpleLooperCallback::handleEvent(int, int, void*)+39) (BuildId: ab4be013cda31e8c45d48aa23a89d0f8)
#36 pc 0001a367 /system/lib/libutils.so (android::Looper::pollInner(int)+1127) (BuildId: ab4be013cda31e8c45d48aa23a89d0f8)
#37 pc 00019e96 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+118) (BuildId: ab4be013cda31e8c45d48aa23a89d0f8)
#38 pc 0010ef8b /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+59) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#39 pc 0021be48 /system/framework/x86/boot-framework.oat (art_jni_trampoline+136) (BuildId: 9a9778e61b43d349325d0bb85244bd9bc95ff387)
#40 pc 02011c16 /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.MessageQueue.next+230)
#41 pc 0013b922 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#42 pc 001d0381 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#43 pc 00386701 /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#44 pc 0037aa3e /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#45 pc 007a11b7 /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+967) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#46 pc 001357a1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#47 pc 003968f0 /system/framework/framework.jar (offset 0x92b000) (android.os.Looper.loop+156)
#48 pc 0036fb02 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.16375758241455872412)+370) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#49 pc 00379c1f /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+207) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#50 pc 0037b4b5 /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+2117) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#51 pc 0018e613 /apex/com.android.art/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+81395) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#52 pc 00142de2 /apex/com.android.art/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#53 pc 001a1688 /system/framework/framework.jar (android.app.ActivityThread.main)
#54 pc 0036fa8e /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.16375758241455872412)+254) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#55 pc 00379b00 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#56 pc 0078b325 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#57 pc 0014220d /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#58 pc 0013baf2 /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#59 pc 001d0392 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#60 pc 00630008 /apex/com.android.art/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+1464) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#61 pc 005886a0 /apex/com.android.art/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+80) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#62 pc 0008a778 /apex/com.android.art/javalib/x86/boot.oat (art_jni_trampoline+168) (BuildId: b386118502376442aa402e8d28c29e95a6eb8614)
#63 pc 0013b922 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#64 pc 001d0381 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#65 pc 00386701 /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#66 pc 0037aa3e /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#67 pc 007a11b7 /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+967) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#68 pc 001357a1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#69 pc 0044928e /system/framework/framework.jar (offset 0x125d000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
#70 pc 0036fb02 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.16375758241455872412)+370) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#71 pc 00379b00 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#72 pc 0078b325 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#73 pc 0014220d /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#74 pc 00893656 /system/framework/x86/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2102) (BuildId: 9a9778e61b43d349325d0bb85244bd9bc95ff387)
#75 pc 0013baf2 /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#76 pc 001d0392 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#77 pc 0062e653 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, char*)+579) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#78 pc 0062eb25 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, char*)+85) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#79 pc 004ce64f /apex/com.android.art/lib/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+735) (BuildId: 8191579dfafff37a5cbca70f9a73020f)
#80 pc 0008f90e /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+62) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#81 pc 00098c8e /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+910) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#82 pc 00003804 /system/bin/app_process32 (main+1588) (BuildId: c5eedbfb6130af84c3db8e121fb1202e)
#83 pc 000522e3 /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+115) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
Lost connection to device.
I am using DeepAR (https://developer.deepar.ai/) in conjunction with Flutter. I am creating a Flutter plugin for Android. I use the JetPack support library CameraX for camera access. The library provides a use case called "ImageAnalyse" (https://developer.android.com/training/camerax/analyze). I try to combine this with DeepAR. The masks that I want to display with DeepAR via the camera are in the App Bundle as assets. When I call "switchEffect", the app crashes.
The Flutter Plugin
The architecture of the Flutter Plugin follows the recommendations in the Flutter documentation.
class ExamplePlugin : FlutterPlugin, ActivityAware {
private var flutterPluginBinding: FlutterPluginBinding? = null
private var activityPluginBinding: ActivityPluginBinding? = null
// overrides are implemented but left out for simplicity
}
class PluginViewFactory(
private val flutterPluginBinding: FlutterPlugin.FlutterPluginBinding, private val activityPluginBinding: ActivityPluginBinding
) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {
override fun create(context: Context?, id: Int, args: Any?): PlatformView {
return PluginView(flutterPluginBinding, activityPluginBinding, context, id, args)
}
}
class PluginView(
flutterPluginBinding: FlutterPluginBinding,
activityPluginBinding: ActivityPluginBinding,
private val context: Context?,
id: Int,
args: Any?
) : PlatformView, MethodChannel.MethodCallHandler, PluginRegistry.RequestPermissionsResultListener,
AREventListener {
private val activity = activityPluginBinding.activity
// I left out some code for simplicity
Creating the ProcessCameraProvider
private fun startCamera() {
val cameraProviderFuture = ProcessCameraProvider.getInstance(activity)
cameraProviderFuture.addListener({
cameraProvider = cameraProviderFuture.get()
bindPreviewAndAnalysis(cameraProvider)
}, ContextCompat.getMainExecutor(activity))
}
Bind image preview and image analysis use cases
private fun bindPreviewAndAnalysis(cameraProvider: ProcessCameraProvider?) {
// Preview
val imagePreview = Preview.Builder()
.build()
.also {
it.setSurfaceProvider(previewView.surfaceProvider)
}
// Analysis
val cameraPreset = CameraResolutionPreset.P1280x720
val width: Int
val height: Int
val orientation: Int = getScreenOrientation()
if (orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE || orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
width = cameraPreset.width
height = cameraPreset.height
} else {
width = cameraPreset.height
height = cameraPreset.width
}
arrayOfNulls<ByteBuffer>(NUMBER_OF_BUFFERS).also { buffers = it }
for (i in 0 until NUMBER_OF_BUFFERS) {
buffers[i] = ByteBuffer.allocateDirect(width * height * 3)
buffers[i]?.order(ByteOrder.nativeOrder())
buffers[i]?.position(0)
}
val imageAnalysis = ImageAnalysis.Builder().setTargetResolution(Size(width, height))
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST).build()
cameraExecutor?.let {
imageAnalysis.setAnalyzer(
it,
{ image ->
val byteData: ByteArray
val yBuffer: ByteBuffer = image.planes[0].buffer
val uBuffer: ByteBuffer = image.planes[1].buffer
val vBuffer: ByteBuffer = image.planes[2].buffer
val ySize: Int = yBuffer.remaining()
val uSize: Int = uBuffer.remaining()
val vSize: Int = vBuffer.remaining()
byteData = ByteArray(ySize + uSize + vSize)
//U and V are swapped
yBuffer.get(byteData, 0, ySize)
vBuffer.get(byteData, ySize, vSize)
uBuffer.get(byteData, ySize + vSize, uSize)
buffers[currentBuffer]?.put(byteData)
buffers[currentBuffer]?.position(0)
if (deepAR != null) {
deepAR?.receiveFrame(
buffers[currentBuffer],
image.width,
image.height,
image.imageInfo.rotationDegrees,
cameraSelector == CameraSelector.DEFAULT_FRONT_CAMERA,
DeepARImageFormat.YUV_420_888,
image.planes[1].pixelStride
)
}
currentBuffer = (currentBuffer + 1) % NUMBER_OF_BUFFERS
image.close()
})
}
try {
cameraProvider?.unbindAll()
cameraSelector?.let {
cameraProvider?.bindToLifecycle(activity as LifecycleOwner,
it, imagePreview, imageAnalysis)
}
} catch (e: Exception) {
Log.e(TAG, "Use case binding failed", e)
}
}
use DeepAR switchEffect
private fun changeMask(mask: String) {
try {
val loader = FlutterInjector.instance().flutterLoader()
val path = loader.getLookupKeyForAsset("assets/masks/$mask", "my_plugin_name")
val maskFd: AssetFileDescriptor = activity.assets.openFd(path)
deepAR?.switchEffect("masks", maskFd.createInputStream())
} catch (exc: Exception) {
Log.e(TAG, "Could not change mask", exc)
}
}
Error
When the "switchEffect" is called, the app crashes with the following error:
F/libc (20852): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 20852 (.example.app), pid 20852 (.example.app)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/walleye/walleye:11/RP1A.201005.004.A1/6934943:user/release-keys'
Revision: 'MP1'
ABI: 'arm64'
Timestamp: 2021-07-25 13:59:29+0200
pid: 20852, tid: 20852, name: .example.app >>> com.example.app <<<
uid: 10194
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
x0 0000007129de3570 x1 0000007129de3570 x2 0000007139e3b210 x3 0000007119769984
x4 0000007ff61c6788 x5 0000000000000000 x6 0000000000000001 x7 6ced3fea237c8a73
x8 0000000000000000 x9 6ced3fea237c8a73 x10 0000000000430000 x11 0000000029de3576
x12 000000005375645e x13 0000007ff61c68a0 x14 0000000000000002 x15 00000000ebad6a89
x16 00000073acaaa7f8 x17 00000073aabc5bd0 x18 00000073af972000 x19 0000007139e3b210
x20 0000007ff61c68b0 x21 00000071d9d95c70 x22 0000000000000001 x23 0000007ff61c68b4
x24 0000000000000000 x25 00000073af273000 x26 0000000000000069 x27 0000007119d77000
x28 0000007ff61c68c0 x29 0000007ff61c6890
lr 000000707f88e504 sp 0000007ff61c6850 pc 000000707f88e514 pst 0000000060000000
backtrace:
#00 pc 000000000004a514 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libnative-lib.so (Java_ai_deepar_ar_DeepAR_switchEffectRawNative+268) (BuildId: 342abf6bf48a1e62b230a5496cbaeecab0b6c701)
#01 pc 000000000013ced4 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: d0f321775158ed00df284edfabf672b6)
#02 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#03 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#04 pc 000000000031c040 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: d0f321775158ed00df284edfabf672b6)
#05 pc 0000000000313288 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+696) (BuildId: d0f321775158ed00df284edfabf672b6)
#06 pc 000000000068b144 /apex/com.android.art/lib64/libart.so (MterpInvokeDirectRange+436) (BuildId: d0f321775158ed00df284edfabf672b6)
#07 pc 000000000012dc14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct_range+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#08 pc 0000000000162a36 [anon:dalvik-classes.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk] (ai.deepar.ar.DeepAR.switchEffect+70)
#09 pc 0000000000685960 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: d0f321775158ed00df284edfabf672b6)
#10 pc 000000000012d814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#11 pc 000000000001a49c [anon:dalvik-classes2.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes2.dex] (com.example.plugin.PluginView.changeMask+296)
#12 pc 0000000000687fe8 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1248) (BuildId: d0f321775158ed00df284edfabf672b6)
#13 pc 000000000012d914 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#14 pc 000000000001a53a [anon:dalvik-classes2.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes2.dex] (com.example.plugin.PluginView.changeMaskNative+42)
#15 pc 0000000000687fe8 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1248) (BuildId: d0f321775158ed00df284edfabf672b6)
#16 pc 000000000012d914 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#17 pc 000000000001a962 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes2.dex] (com.example.plugin.PluginView.onMethodCall+154)
#18 pc 00000000006873a4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: d0f321775158ed00df284edfabf672b6)
#19 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#20 pc 000000000036ef32 [anon:dalvik-classes6.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes6.dex] (io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage+34)
#21 pc 00000000006873a4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: d0f321775158ed00df284edfabf672b6)
#22 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#23 pc 0000000000364daa [anon:dalvik-classes6.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes6.dex] (io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart+114)
#24 pc 00000000006873a4 /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1812) (BuildId: d0f321775158ed00df284edfabf672b6)
#25 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#26 pc 0000000000363a64 [anon:dalvik-classes6.dex extracted in memory from /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/base.apk!classes6.dex] (io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage+8)
#27 pc 00000000003094d0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+264) (BuildId: d0f321775158ed00df284edfabf672b6)
#28 pc 00000000006740c0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: d0f321775158ed00df284edfabf672b6)
#29 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d0f321775158ed00df284edfabf672b6)
#30 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#31 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#32 pc 000000000055c6f4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+468) (BuildId: d0f321775158ed00df284edfabf672b6)
#33 pc 000000000055c894 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: d0f321775158ed00df284edfabf672b6)
#34 pc 00000000004197f8 /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+656) (BuildId: d0f321775158ed00df284edfabf672b6)
#35 pc 000000000037deac /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2532) (BuildId: d0f321775158ed00df284edfabf672b6)
#36 pc 000000000036bc50 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+72) (BuildId: d0f321775158ed00df284edfabf672b6)
#37 pc 000000000132663c /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#38 pc 0000000001326578 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#39 pc 0000000001322408 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#40 pc 000000000138428c /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#41 pc 0000000001342568 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#42 pc 00000000013476f8 /data/app/~~tCz51U3rHjeb2hAFXQB6yw==/com.example.app-xzIovrW9JsSRapHSrOSbnA==/lib/arm64/libflutter.so (BuildId: 137d09ab83a412ded1c33ef386351fcc0429a53b)
#43 pc 000000000001a064 /system/lib64/libutils.so (android::Looper::pollInner(int)+916) (BuildId: b81fad2b6b7b7f85c6217d2cb80c9e61)
#44 pc 0000000000019c68 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) (BuildId: b81fad2b6b7b7f85c6217d2cb80c9e61)
#45 pc 00000000001120f4 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) (BuildId: 30f3430e4d2a28be49d3c60d623f0a29)
#46 pc 000000000020fadc /system/framework/arm64/boot-framework.oat (art_jni_trampoline+140) (BuildId: da25c976c2d1d3af123868772655a0779f8f6a48)
#47 pc 000000000200b6cc /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.MessageQueue.next+204)
#48 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#49 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#50 pc 000000000031c040 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: d0f321775158ed00df284edfabf672b6)
#51 pc 0000000000312228 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: d0f321775158ed00df284edfabf672b6)
#52 pc 00000000006856c0 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+848) (BuildId: d0f321775158ed00df284edfabf672b6)
#53 pc 000000000012d814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#54 pc 0000000000396970 /system/framework/framework.jar (offset 0x92b000) (android.os.Looper.loop+156)
#55 pc 00000000003094d0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+264) (BuildId: d0f321775158ed00df284edfabf672b6)
#56 pc 0000000000311840 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#57 pc 0000000000312b9c /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1772) (BuildId: d0f321775158ed00df284edfabf672b6)
#58 pc 0000000000178658 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+58656) (BuildId: d0f321775158ed00df284edfabf672b6)
#59 pc 000000000013f7d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: d0f321775158ed00df284edfabf672b6)
#60 pc 00000000001a1698 /system/framework/framework.jar (android.app.ActivityThread.main)
#61 pc 00000000003095d8 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+528) (BuildId: d0f321775158ed00df284edfabf672b6)
#62 pc 00000000006740c0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: d0f321775158ed00df284edfabf672b6)
#63 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d0f321775158ed00df284edfabf672b6)
#64 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: d0f321775158ed00df284edfabf672b6)
#65 pc 00000000001a9804 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: d0f321775158ed00df284edfabf672b6)
#66 pc 000000000055ce14 /apex/com.android.art/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1364) (BuildId: d0f321775158ed00df284edfabf672b6)
#67 pc 00000000004dba28 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+48) (BuildId: d0f321775158ed00df284edfabf672b6)
#68 pc 00000000000896f4 /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+180) (BuildId: 13577ce71153c228ecf0eb73fc39f45010d487f8)
#69 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d0f321775158ed00df284edfabf672b6)
#70 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: d0f321775158ed00df284edfabf672b6)
#71 pc 000000000031c040 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: d0f321775158ed00df284edfabf672b6)
#72 pc 0000000000312228 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: d0f321775158ed00df284edfabf672b6)
#73 pc 00000000006856c0 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+848) (BuildId: d0f321775158ed00df284edfabf672b6)
#74 pc 000000000012d814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d0f321775158ed00df284edfabf672b6)
#75 pc 000000000044930a /system/framework/framework.jar (offset 0x125d000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
#76 pc 00000000003094d0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7618685802058321727)+264) (BuildId: d0f321775158ed00df284edfabf672b6)
#77 pc 00000000006740c0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: d0f321775158ed00df284edfabf672b6)
#78 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d0f321775158ed00df284edfabf672b6)
#79 pc 0000000000897668 /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2280) (BuildId: da25c976c2d1d3af123868772655a0779f8f6a48)
#80 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: d0f321775158ed00df284edfabf672b6)
#81 pc 00000000001a9804 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: d0f321775158ed00df284edfabf672b6)
#82 pc 000000000055b830 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+448) (BuildId: d0f321775158ed00df284edfabf672b6)
#83 pc 000000000055bcf4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: d0f321775158ed00df284edfabf672b6)
#84 pc 000000000043ecbc /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+652) (BuildId: d0f321775158ed00df284edfabf672b6)
#85 pc 000000000009948c /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+124) (BuildId: 30f3430e4d2a28be49d3c60d623f0a29)
#86 pc 00000000000a0a0c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+844) (BuildId: 30f3430e4d2a28be49d3c60d623f0a29)
#87 pc 0000000000003570 /system/bin/app_process64 (main+1320) (BuildId: d4686d3f8282764488eb9ca7cc518583)
#88 pc 00000000000495b4 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: c78cdff5b820a550771130d6bde95081)
Lost connection to device.
Environment
Kotlin 1.5.20
Flutter 2.2.3
DeepAR 2.4.1
CameraX 1.1.0-alpha07 / 1.0.0-alpha27
Additional notes
I see this error when running a Flutter App with Flutter Plugin on an Android Emulator (API Level 30) and on a real Android Device (Pixel 2, Android 11). I see this error when running the Flutter App in Debug-Mode and in Release-Mode.
Any help or any suggestions are very welcome. I'm quit new to Flutter and Android-Development, so there is a good chance I may have missed some important aspects.
I also posted this question in the GitHub repo of DeepAR: https://github.com/DeepARSDK/quickstart-android-java/issues/30
Just wanted to let you know, that I have chosen a different approach now. In the end I'm using "switchEffect" with a FileInputStream and that works well:
private fun getMaskAsFileInputStream(mask: String): FileInputStream? {
return try {
val loader = FlutterInjector.instance().flutterLoader()
val path = loader.getLookupKeyForAsset("assets/masks/$mask", "my_plugin_name")
val maskFd: AssetFileDescriptor = activity.assets.openFd(path)
if (maskFd.length > 0) {
maskFd.createInputStream()
} else {
Log.w(TAG, "Mask asset at $path is empty")
null
}
} catch (exc: Exception) {
Log.e(TAG, "Could not get mask as file input stream", exc)
null
}
}
private fun changeMask(mask: String) {
try {
deepAR?.switchEffect("masks", getMaskAsFileInputStream(mask))
} catch (exc: Exception) {
Log.e(TAG, "Could not change mask", exc)
}
}
I have an app in Google Play store and every couple of weeks, I see crash report with native stack like this in the Google Play Console:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> sk.mimac.slideshow <<<
backtrace:
#00 pc 000000000001ce72 /system/lib/libc.so (abort+62)
#01 pc 00000000000169e8 /system/lib/libminikin.so (abort_with_message(char const*)+24)
#02 pc 0000000000016a44 /system/lib/libminikin.so (__ubsan_handle_add_overflow_minimal_abort+24)
#03 pc 000000000000f22b /system/lib/libminikin.so (void minikin::LayoutCache::getOrCreate<minikin::LayoutAppendFunctor>(minikin::U16StringPiece const&, minikin::Range const&, minikin::MinikinPaint const&, bool, minikin::StartHyphenEdit, minikin::EndHyphenEdit, minikin::LayoutAppendFunctor&)+542)
#04 pc 000000000000ed2d /system/lib/libminikin.so (minikin::Layout::doLayoutWord(unsigned short const*, unsigned int, unsigned int, unsigned int, bool, minikin::MinikinPaint const&, unsigned int, minikin::StartHyphenEdit, minikin::EndHyphenEdit, minikin::LayoutPieces const*, minikin::Layout*, float*, minikin::MinikinExtent*, minikin::MinikinRect*, minikin::LayoutPieces*)+204)
#05 pc 000000000000e8d5 /system/lib/libminikin.so (minikin::Layout::doLayoutRunCached(minikin::U16StringPiece const&, minikin::Range const&, bool, minikin::MinikinPaint const&, unsigned int, minikin::StartHyphenEdit, minikin::EndHyphenEdit, minikin::LayoutPieces const*, minikin::Layout*, float*, minikin::MinikinExtent*, minikin::MinikinRect*, minikin::LayoutPieces*)+244)
#06 pc 000000000000ec09 /system/lib/libminikin.so (minikin::Layout::measureText(minikin::U16StringPiece const&, minikin::Range const&, minikin::Bidi, minikin::MinikinPaint const&, minikin::StartHyphenEdit, minikin::EndHyphenEdit, float*, minikin::MinikinExtent*, minikin::LayoutPieces*)+140)
#07 pc 00000000000890fd /system/lib/libhwui.so (android::MinikinUtils::measureText(android::Paint const*, minikin::Bidi, android::Typeface const*, unsigned short const*, unsigned int, unsigned int, unsigned int, float*)+76)
#08 pc 00000000000d9813 /system/lib/libandroid_runtime.so (android::PaintGlue::getRunAdvance___CIIIIZI_F(_JNIEnv*, _jclass*, long long, _jcharArray*, int, int, int, int, unsigned char, int)+202)
#09 pc 00000000003b3ce3 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.graphics.Paint.nGetRunAdvance+178)
#10 pc 00000000006f0725 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.graphics.Paint.getRunAdvance+172)
#11 pc 00000000006f05c3 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.graphics.Paint.getRunAdvance+250)
#12 pc 0000000000973fb9 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.TextLine.getRunAdvance+128)
#13 pc 0000000000974ea9 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.TextLine.handleText+312)
#14 pc 0000000000974b67 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.TextLine.handleRun+2326)
#15 pc 0000000000975ab1 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.TextLine.measure+216)
#16 pc 0000000000975fdd /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.TextLine.metrics+44)
#17 pc 0000000000968631 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.Layout.getLineExtent+392)
#18 pc 000000000096a8bf /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.Layout.drawText+2006)
#19 pc 0000000000969b31 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.text.Layout.draw+128)
#20 pc 0000000000b456fd /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.widget.TextView.onDraw+2804)
#21 pc 0000000000a7a98b /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.draw+202)
#22 pc 0000000000a91ec9 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.updateDisplayListIfDirty+944)
#23 pc 0000000000a7b78f /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.draw+1014)
#24 pc 0000000000b1c4cf /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ViewGroup.drawChild+54)
#25 pc 0000000000b19a4b /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ViewGroup.dispatchDraw+1290)
#26 pc 0000000000a7a99b /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.draw+218)
#27 pc 0000000000a91ec9 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.updateDisplayListIfDirty+944)
#28 pc 0000000000b1a0d7 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ViewGroup.dispatchGetDisplayList+182)
#29 pc 0000000000a91c0f /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.updateDisplayListIfDirty+246)
#30 pc 0000000000b1a0d7 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ViewGroup.dispatchGetDisplayList+182)
#31 pc 0000000000a91c0f /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.updateDisplayListIfDirty+246)
#32 pc 0000000000b1a0d7 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ViewGroup.dispatchGetDisplayList+182)
#33 pc 0000000000a91c0f /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.updateDisplayListIfDirty+246)
#34 pc 0000000000b1a0d7 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ViewGroup.dispatchGetDisplayList+182)
#35 pc 0000000000a91c0f /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.updateDisplayListIfDirty+246)
#36 pc 0000000000b1a0d7 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ViewGroup.dispatchGetDisplayList+182)
#37 pc 0000000000a91c0f /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.View.updateDisplayListIfDirty+246)
#38 pc 00000000009ba3f5 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ThreadedRenderer.updateViewTreeDisplayList+76)
#39 pc 00000000009ba155 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ThreadedRenderer.updateRootDisplayList+212)
#40 pc 00000000009ba4c9 /system/framework/arm/boot-framework.oat (offset 0x3ac000) (android.view.ThreadedRenderer.draw+168)
#41 pc 000000000002b915 /dev/ashmem/dalvik-jit-code-cache (deleted)
So far, I haven't been able to reproduce this bug / problem / crash
Similar reports are coming from various devices, mostly with Android 9 (although it might be just a coincidence)
"sk.mimac.slideshow" is the package of my app
"libminikin" is apparently some Android library, although I have no idea what it does
Is there any way to find out what might be the cause of this crash?