lottie-react-native: Android app crashes at start, RN 0.59.4

Description

App crashes when start. BTW there is no build problem.

Steps to Reproduce

Create a new project then just import the library. Finally, react-native run-android.

Versions

Lottie: 3.0.4 and 3.0.3 (i tested both) RN: 0.59.4

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 20 (2 by maintainers)

Most upvoted comments

make sure that the import syntax below

import LottieView from ‘lottie-react-native’;

Did you guys give a try to the ** IMPORTANT ** section in the documentation? It states what to do if your app crashes

Yes, i followed all instructions.

"lottie-ios": "2.5.0",
"lottie-react-native": "2.6.1"

It works for me. Thanks @emilioicai 👍

Not working on RN 0.59.10.

TypeError: undefined is not an object (evaluating '_reactNative.UIManager.LottieAnimationView.Commands')

I will try again. i will edit this post soon.

Edit: Not working on RN 0.59.10. App crashes at start.

"lottie-ios": "2.5.0",
"lottie-react-native": "2.6.1"

It works for me. Thanks @emilioicai 👍

Same on 0.59.10 with 3.0.3:

JNI DETECTED ERROR IN APPLICATION: field operation on NULL object: 0x0
    in call to GetObjectField
    from void com.facebook.react.bridge.queue.NativeRunnable.run()
"mqt_js" prio=5 tid=52 Runnable
  | group="main" sCount=0 dsCount=0 flags=0 obj=0x13583ff0 self=0x8d7a4600
  | sysTid=21985 nice=-4 cgrp=default sched=0/0 handle=0x80f95970
  | state=R schedstat=( 1371665572 227601000 1304 ) utm=100 stm=37 core=1 HZ=100
  | stack=0x80e93000-0x80e95000 stackSize=1038KB
  | held mutexes= "mutator lock"(shared held)
  native: #00 pc 0047eae1  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*)+209)
  native: #01 pc 0057c193  /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+355)
  native: #02 pc 00577693  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+83)
  native: #03 pc 00395256  /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1254)
  native: #04 pc 003956c1  /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, char*)+113)
  native: #05 pc 0014f207  /system/lib/libart.so (art::ScopedCheck::AbortF(char const*, ...)+71)
  native: #06 pc 00155d6a  /system/lib/libart.so (art::ScopedCheck::CheckInstanceFieldID(art::ScopedObjectAccess&, _jobject*, _jfieldID*)+458)
  native: #07 pc 0015544e  /system/lib/libart.so (art::ScopedCheck::CheckFieldAccess(art::ScopedObjectAccess&, _jobject*, _jfieldID*, bool, art::Primitive::Type)+110)
  native: #08 pc 00154bae  /system/lib/libart.so (art::CheckJNI::GetField(char const*, _JNIEnv*, _jobject*, _jfieldID*, bool, art::Primitive::Type)+1134)
  native: #09 pc 0013edf6  /system/lib/libart.so (art::CheckJNI::GetObjectField(_JNIEnv*, _jobject*, _jfieldID*)+70)
  native: #10 pc 0006c740  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (facebook::jni::HybridClass<facebook::react::WritableNativeMap, facebook::react::ReadableNativeMap>::JavaPart::cthis()+144)
  native: #11 pc 0006b095  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (facebook::react::MethodInvoker::invoke(std::__ndk1::weak_ptr<facebook::react::Instance>&, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::react::JBaseJavaModule, facebook::jni::JObject, void>::_javaobject*>, folly::dynamic const&)+2325)
  native: #12 pc 0005ffbd  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (_ZN8facebook5react16JavaNativeModule26callSerializableNativeHookEjON5folly7dynamicE+173)
  native: #13 pc 000a138a  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (_ZN8facebook5react14ModuleRegistry26callSerializableNativeHookEjjON5folly7dynamicE+74)
  native: #14 pc 000a496e  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (_ZN8facebook5react16JsToNativeBridge26callSerializableNativeHookERNS0_10JSExecutorEjjON5folly7dynamicE+46)
  native: #15 pc 00019caa  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjscexecutor.so (facebook::react::JSIExecutor::nativeCallSyncHook(facebook::jsi::Value const*, unsigned int)+298)
  native: #16 pc 0001adec  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjscexecutor.so (???)
  native: #17 pc 00024e6f  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjscexecutor.so (???)
  native: #18 pc 0005d7a1  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (JSC::JSCallbackObject<JSC::JSDestructibleObject>::call(JSC::ExecState*)+465)
  native: #19 pc 001cdc39  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (JSC::LLInt::setUpCall(JSC::ExecState*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)+601)
  native: #20 pc 001c8445  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (llint_slow_path_tail_call+245)
  native: #21 pc 001b5870  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (JSC::LLInt::CLoop::execute(JSC::OpcodeID, void*, JSC::VM*, JSC::ProtoCallFrame*, bool)+79600)
  native: #22 pc 001cbaf2  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (vmEntryToJavaScript+50)
  native: #23 pc 0019be84  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (JSC::Interpreter::executeProgram(JSC::SourceCode const&, JSC::ExecState*, JSC::JSObject*)+13988)
  native: #24 pc 0033cf74  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&)+308)
  native: #25 pc 0033d16e  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (JSC::profiledEvaluate(JSC::ExecState*, JSC::ProfilingReason, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&)+270)
  native: #26 pc 000546b6  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjsc.so (JSEvaluateScript+758)
  native: #27 pc 0001fd06  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjscexecutor.so (facebook::jsc::JSCRuntime::evaluateJavaScript(std::__ndk1::unique_ptr<facebook::jsi::Buffer const, std::__ndk1::default_delete<facebook::jsi::Buffer const>>, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)+326)
  native: #28 pc 00017005  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libjscexecutor.so (facebook::react::JSIExecutor::loadApplicationScript(std::__ndk1::unique_ptr<facebook::react::JSBigString const, std::__ndk1::default_delete<facebook::react::JSBigString const>>, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>)+2229)
  native: #29 pc 000a4e60  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (???)
  native: #30 pc 000a6d9e  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (???)
  native: #31 pc 0005a297  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (???)
  native: #32 pc 0004e412  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (_ZN8facebook3jni6detail13MethodWrapperIMNS_5react15JNativeRunnableEFvvEXadL_ZNS4_3runEvEES4_vJEE8dispatchENS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassIS4_NS3_8RunnableEE8JavaPartESB_vE11_javaobjectEEE+50)
  native: #33 pc 0004e379  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (_ZN8facebook3jni6detail15FunctionWrapperIPFvNS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassINS_5react15JNativeRunnableENS6_8RunnableEE8JavaPartES8_vE11_javaobjectEEEEXadL_ZNS1_13MethodWrapperIMS7_FvvEXadL_ZNS7_3runEvEES7_vJEE8dispatchESE_EESD_vJEE4callEP7_JNIEnvP8_jobject+73)
  native: #34 pc 0004e323  /data/app/com.classpass.classpass.beta-YU6uImhqoEZAG36towuiUg==/lib/x86/libreactnativejni.so (_ZN8facebook3jni6detail13MethodWrapperIMNS_5react15JNativeRunnableEFvvEXadL_ZNS4_3runEvEES4_vJEE4callEP7_JNIEnvP8_jobject+35)
  native: #35 pc 00648267  /system/lib/libart.so (art_quick_generic_jni_trampoline+71)
  native: #36 pc 00642262  /system/lib/libart.so (art_quick_invoke_stub+338)
  native: #37 pc 001160cf  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+223)
  native: #38 pc 0032153f  /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+335)
  native: #39 pc 0031a7a4  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+836)
  native: #40 pc 00628fdf  /system/lib/libart.so (MterpInvokeInterface+1647)
  native: #41 pc 006334a1  /system/lib/libart.so (artMterpAsmInstructionStart+14625)
  native: #42 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
  native: #43 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
  native: #44 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
  native: #45 pc 0062964a  /system/lib/libart.so (MterpInvokeStatic+282)
  native: #46 pc 00633421  /system/lib/libart.so (artMterpAsmInstructionStart+14497)
  native: #47 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
  native: #48 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
  native: #49 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
  native: #50 pc 006285be  /system/lib/libart.so (MterpInvokeSuper+1710)
  native: #51 pc 00633321  /system/lib/libart.so (artMterpAsmInstructionStart+14241)
  native: #52 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
  native: #53 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
  native: #54 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
  native: #55 pc 00627e14  /system/lib/libart.so (MterpInvokeVirtual+756)
  native: #56 pc 006332a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
  native: #57 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
  native: #58 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
  native: #59 pc 0031a78a  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+810)
  native: #60 pc 0062964a  /system/lib/libart.so (MterpInvokeStatic+282)
  native: #61 pc 00633421  /system/lib/libart.so (artMterpAsmInstructionStart+14497)
  native: #62 pc 002f3a2b  /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+539)
  native: #63 pc 002fa2e7  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+231)
  at com.facebook.react.bridge.queue.NativeRunnable.run(Native method)
  at android.os.Handler.handleCallback(Handler.java:790)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
  at android.os.Looper.loop(Looper.java:164)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
  at java.lang.Thread.run(Thread.java:764)

make sure that the import syntax below

import LottieView from ‘lottie-react-native’;

It’s not so simple @karthiganesan90 I think…

Did you guys give a try to the _ IMPORTANT _ section in the documentation? It states what to do if your app crashes