Flutterfire: [cloud_firestore] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/firestore/Source

Created on 18 Sep 2019  Â·  3Comments  Â·  Source: FirebaseExtended/flutterfire

Steps to Reproduce

The cloud firestore is crashing the app.
The line is shown below

var querySnapshot = await Firestore.instance.collection(_store).getDocuments();

Logs

E/flutter (22449): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/firestore/Source;
E/flutter (22449):  at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin.getSource(CloudFirestorePlugin.java:121)
E/flutter (22449):  at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin.onMethodCall(CloudFirestorePlugin.java:687)
E/flutter (22449):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/flutter (22449):  at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/flutter (22449):  at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:645)
E/flutter (22449):  at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (22449):  at android.os.MessageQueue.next(MessageQueue.java:326)
E/flutter (22449):  at android.os.Looper.loop(Looper.java:160)
E/flutter (22449):  at android.app.ActivityThread.main(ActivityThread.java:6669)
E/flutter (22449):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter (22449):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/flutter (22449):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/flutter (22449): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.firestore.Source" on path: DexPathList[[zip file "/data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/base.apk"],nativeLibraryDirectories=[/data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86, /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/base.apk!/lib/x86, /system/lib]]
E/flutter (22449):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
E/flutter (22449):  at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/flutter (22449):  at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/flutter (22449):  ... 12 more
E/flutter (22449): 
F/flutter (22449): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env). 
F/libc    (22449): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 22449 (ypowerapp334891), pid 22449 (ypowerapp334891)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_x86/generic_x86:9/PSR1.180720.075/5124027:user/release-keys'
Revision: '0'
ABI: 'x86'
pid: 22449, tid: 22449, name: ypowerapp334891  >>> com.ionicframework.buypowerapp334891 <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env). 
'
    eax 00000000  ebx 000057b1  ecx 000057b1  edx 00000006
    edi 000057b1  esi 00000070
    ebp ffbc6ba8  esp ffbc6b48  eip e903bb39
backtrace:
    #00 pc 00000b39  [vdso:e903b000] (__kernel_vsyscall+9)
    #01 pc 0001fdf8  /system/lib/libc.so (syscall+40)
    #02 pc 00022ed3  /system/lib/libc.so (abort+115)
    #03 pc 011184d5  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #04 pc 011065a1  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #05 pc 01104344  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #06 pc 011664a9  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #07 pc 01116c51  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #08 pc 011192bb  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #09 pc 01119200  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #10 pc 0111f908  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #11 pc 0111f936  /data/app/com.ionicframework.buypowerapp334891-lWIQ-4Ta0Vn2pdkqjUlaRg==/lib/x86/libflutter.so (offset 0x10fd000)
    #12 pc 00012a77  /system/lib/libutils.so (android::SimpleLooperCallback::handleEvent(int, int, void*)+39)
    #13 pc 00013896  /system/lib/libutils.so (android::Looper::pollInner(int)+998)
    #14 pc 0001340b  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+43)
    #15 pc 000e414b  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+59)
    #16 pc 003ddb28  /system/framework/x86/boot-framework.oat (offset 0x3ca000) (android.media.MediaExtractor.seekTo [DEDUPED]+136)
    #17 pc 005f0b82  /system/lib/libart.so (art_quick_invoke_stub+338)
    #18 pc 000a30ce  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+222)
    #19 pc 0029bca2  /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+338)
    #20 pc 00293e48  /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1048)
    #21 pc 005bda66  /system/lib/libart.so (MterpInvokeDirect+342)
    #22 pc 005e2e21  /system/lib/libart.so (ExecuteMterpImpl+14497)
    #23 pc 00aeae98  /system/framework/boot-framework.vdex (android.os.MessageQueue.next+38)
    #24 pc 00266216  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2093054539+598)
    #25 pc 0026c79c  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+220)
    #26 pc 00293e2b  /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1019)
    #27 pc 005bc493  /system/lib/libart.so (MterpInvokeVirtual+691)
    #28 pc 005e2d21  /system/lib/libart.so (ExecuteMterpImpl+14241)
    #29 pc 00aea944  /system/framework/boot-framework.vdex (android.os.Looper.loop+128)
    #30 pc 00266216  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2093054539+598)
    #31 pc 0026c79c  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+220)
    #32 pc 00293e2b  /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1019)
    #33 pc 005bdc5f  /system/lib/libart.so (MterpInvokeStatic+207)
    #34 pc 005e2ea1  /system/lib/libart.so (ExecuteMterpImpl+14625)
    #35 pc 00384ca2  /system/framework/boot-framework.vdex (android.app.ActivityThread.main+214)
    #36 pc 00266216  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2093054539+598)
    #37 pc 0026c68e  /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+126)
    #38 pc 005a953d  /system/lib/libart.so (artQuickToInterpreterBridge+1277)
    #39 pc 005f6c6d  /system/lib/libart.so (art_quick_to_interpreter_bridge+77)
    #40 pc 005f0d52  /system/lib/libart.so (art_quick_invoke_static_stub+418)
    #41 pc 000a30df  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+239)
    #42 pc 004d3349  /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+89)
    #43 pc 004d502e  /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+1422)
    #44 pc 00449783  /system/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+83)
    #45 pc 0011d778  /system/framework/x86/boot.oat (offset 0x114000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+168)
    #46 pc 005f0b82  /system/lib/libart.so (art_quick_invoke_stub+338)
    #47 pc 000a30ce  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+222)
    #48 pc 0029bca2  /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+338)
    #49 pc 00293e48  /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1048)
    #50 pc 005bc493  /system/lib/libart.so (MterpInvokeVirtual+691)
    #51 pc 005e2d21  /system/lib/libart.so (ExecuteMterpImpl+14241)
    #52 pc 00c0b7d2  /system/framework/boot-framework.vdex (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
    #53 pc 00266216  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2093054539+598)
    #54 pc 0026c68e  /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+126)
    #55 pc 005a953d  /system/lib/libart.so (artQuickToInterpreterBridge+1277)
    #56 pc 005f6c6d  /system/lib/libart.so (art_quick_to_interpreter_bridge+77)
    #57 pc 00badc3c  /system/framework/x86/boot-framework.oat (offset 0x3ca000) (com.android.internal.os.ZygoteInit.main+3100)
    #58 pc 005f0d52  /system/lib/libart.so (art_quick_invoke_static_stub+418)
    #59 pc 000a30df  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+239)
    #60 pc 004d3349  /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+89)
    #61 pc 004d2fcd  /system/lib/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, char*)+429)
    #62 pc 003a784d  /system/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+925)
    #63 pc 000d9273  /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, char*, art::Primitive::Type, art::InvokeType)+2867)
    #64 pc 000c6d29  /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+73)
    #65 pc 0007097e  /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+62)
    #66 pc 00073e78  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+744)
    #67 pc 00001bb2  /system/bin/app_process32 (main+1506)
    #68 pc 000c0f54  /system/lib/libc.so (__libc_init+100)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/temitopeomotunde/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • CocoaPods version 1.7.4

[✓] Android Studio
    • Android Studio at /Applications/Android Studio 3.4 Preview.app/Contents
    • Flutter plugin version 32.0.1
    • Dart plugin version 182.5124
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b22)

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.38.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.4.1

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!

bug

Most helpful comment

Yes, I added

implementation 'com.google.firebase:firebase-firestore:19.0.0'

to app/build.gradle

All 3 comments

Did you solve this issue?

Yes, I added

implementation 'com.google.firebase:firebase-firestore:19.0.0'

to app/build.gradle

Ok, this actually worked, but I have no idea why. Why this is not even mentioned on Firebase Flutter docs?

Was this page helpful?
0 / 5 - 0 ratings