Search code examples
androidlitho

App crashing on start when using facebooks litho library


I wanted to try the litho library from facebook for recycler view. Read the official docs and few other articles, and i started implementing using a basic example of hello world. But the app shows a white screen and crashes without displaying anything.

Searched online and few told to add multidex support, but multidex is by default enabled after sdk version 23. will attach my logcat for ref.

2020-03-16 12:22:23.407 21721-21721/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 21721 (e.lithopractice), pid 21721 (e.lithopractice)
2020-03-16 12:22:23.443 21741-21763/? E/SchedPolicy: open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: Build fingerprint: 'motorola/sanders_n/sanders_n:8.1.0/OPS28.65-36-14/63857:user/release-keys'
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: Revision: 'p400'
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: ABI: 'arm'
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: pid: 21721, tid: 21721, name: e.lithopractice  >>> com.example.lithopractice <<<
2020-03-16 12:22:23.500 21768-21768/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG: Abort message: 'java_vm_ext.cc:553] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "com.facebook.jni.HybridData$Destructor" on path: DexPathList[[zip file "/data/app/com.example.lithopractice-V8_NylBQ4pUmXdNPUV2stQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.lithopractice-V8_NylBQ4pUmXdNPUV2stQ==/lib/arm, /data/app/com.example.lithopractice-V8_NylBQ4pUmXdNPUV2stQ==/base.apk!/lib/armeabi-v7a, /system/lib,
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG:     r0 00000000  r1 000054d9  r2 00000006  r3 00000008
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG:     r4 000054d9  r5 000054d9  r6 beac46d4  r7 0000010c
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG:     r8 00000000  r9 ae499380  sl 0000000a  fp beac4720
2020-03-16 12:22:23.501 21768-21768/? A/DEBUG:     ip a65a5de0  sp beac46c0  lr af1be92d  pc af1b841a  cpsr 200f0030
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG: backtrace:
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG:     #00 pc 0001a41a  /system/lib/libc.so (abort+63)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG:     #01 pc 0035ce99  /system/lib/libart.so (art::Runtime::Abort(char const*)+392)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG:     #02 pc 0041ca0d  /system/lib/libart.so (android::base::LogMessage::~LogMessage()+452)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG:     #03 pc 0024eb19  /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1212)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG:     #04 pc 0024ec9b  /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+58)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG:     #05 pc 000d61d3  /system/lib/libart.so (art::ScopedCheck::AbortF(char const*, ...)+42)
2020-03-16 12:22:23.632 21768-21768/? A/DEBUG:     #06 pc 000d5d53  /system/lib/libart.so (art::ScopedCheck::CheckThread(_JNIEnv*)+274)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #07 pc 000d46fd  /system/lib/libart.so (art::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::JniValueType*)+596)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #08 pc 000d6aaf  /system/lib/libart.so (art::CheckJNI::NewRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+434)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #09 pc 003814a1  /system/lib/libart.so (art::Thread::SetClassLoaderOverride(_jobject*)+32)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #10 pc 002509fb  /system/lib/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, _jobject*, _jstring*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+1910)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #11 pc 0000315f  /system/lib/libopenjdkjvm.so (JVM_NativeLoad+194)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #12 pc 00254641  /system/framework/arm/boot-core-oj.oat (offset 0x1cb000) (java.lang.Runtime.nativeLoad+160)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #13 pc 00403375  /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #14 pc 004085eb  /system/lib/libart.so (art_quick_invoke_static_stub+226)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #15 pc 000b00df  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+174)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #16 pc 0035769d  /system/lib/libart.so (art::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::ArgArray*, art::JValue*, char const*)+52)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #17 pc 00358bbb  /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+954)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #18 pc 00308645  /system/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobject*)+40)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #19 pc 002389ff  /system/framework/arm/boot-core-oj.oat (offset 0x1cb000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #20 pc 00403375  /system/lib/libart.so (art_quick_invoke_stub_internal+68)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #21 pc 004084e5  /system/lib/libart.so (art_quick_invoke_stub+228)
2020-03-16 12:22:23.633 21768-21768/? A/DEBUG:     #22 pc 000b00bb  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+138)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #23 pc 00201f3b  /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+226)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #24 pc 001fd4bd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+592)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #25 pc 003ed49b  /system/lib/libart.so (MterpInvokeVirtual+482)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #26 pc 003f5714  /system/lib/libart.so (ExecuteMterpImpl+14228)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #27 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #28 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #29 pc 001fd4a5  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #30 pc 003ee087  /system/lib/libart.so (MterpInvokeInterface+1078)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #31 pc 003f5914  /system/lib/libart.so (ExecuteMterpImpl+14740)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #32 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #33 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #34 pc 001fd4a5  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #35 pc 003ed49b  /system/lib/libart.so (MterpInvokeVirtual+482)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #36 pc 003f5714  /system/lib/libart.so (ExecuteMterpImpl+14228)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #37 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #38 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #39 pc 001fd4a5  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #40 pc 003ed49b  /system/lib/libart.so (MterpInvokeVirtual+482)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #41 pc 003f5714  /system/lib/libart.so (ExecuteMterpImpl+14228)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #42 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #43 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #44 pc 001fd4a5  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #45 pc 003ee4b5  /system/lib/libart.so (MterpInvokeStatic+184)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #46 pc 003f5894  /system/lib/libart.so (ExecuteMterpImpl+14612)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #47 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #48 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #49 pc 001fd4a5  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #50 pc 003ee4b5  /system/lib/libart.so (MterpInvokeStatic+184)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #51 pc 003f5894  /system/lib/libart.so (ExecuteMterpImpl+14612)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #52 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #53 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #54 pc 001fd4a5  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #55 pc 003ee4b5  /system/lib/libart.so (MterpInvokeStatic+184)
2020-03-16 12:22:23.634 21768-21768/? A/DEBUG:     #56 pc 003f5894  /system/lib/libart.so (ExecuteMterpImpl+14612)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG:     #57 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG:     #58 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG:     #59 pc 001fd4a5  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+568)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG:     #60 pc 003ee347  /system/lib/libart.so (MterpInvokeDirect+250)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG:     #61 pc 003f5814  /system/lib/libart.so (ExecuteMterpImpl+14484)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG:     #62 pc 001e3f11  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+344)
2020-03-16 12:22:23.635 21768-21768/? A/DEBUG:     #63 pc 001e85d5  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+148)
2020-03-16 12:22:24.114 21767-21775/? E/SchedPolicy: open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory
2020-03-16 12:22:24.861 1171-1171/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_07 ```

Solution

  • Adding the following dependecy solves the problem. Just incase anyone ever needs it.

    implementation 'com.facebook.fbjni:fbjni:0.0.2'