Crash during database initialization while running Flutter application - no static method logCallback

I’m having difficulty running an app that I’ve published on the Google play store.

An error keeps occurring when installing an application via the play store, but not during debugging or testing. It results in a crash, preventing the use of the application.

I believe the crash occurs while initiating the database as this starts, but never succeeds.

The error is:

E/flutter: [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoSuchMethodError: no static method “Lcom/couchbase/litecore/C4Log;.logCallback(Ljava/lang/String;ILjava/lang/String;)V”
at com.couchbase.litecore.C4Log.setCallbackLevel(Native Method)
at com.couchbase.a.ar.(Unknown Source:23)
at com.couchbase.a.a.(Unknown Source:5)
at com.b.a.a.b(Unknown Source:8)
at com.b.a.c$a.onMethodCall(Unknown Source:1043)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(Unknown Source:17)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(Unknown Source:59)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:6)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:325)
at android.os.Looper.loop(Looper.java:142)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

I’m using flutter for development and [GitHub - SaltechSystems/couchbase_lite: Flutter plugin for the Community edition of Couchbase Lite. Couchbase Lite is an embedded lightweight, document-oriented (NoSQL), syncable database engine.](this couchbase lite plugin) to access couchbase lite. I don’t believe it’s an issue with the plugin or my code, but rather with couchbase calling a method that doesn’t exist.

1 Like

For Android development - not Flutter - there is a “Proguard” file where you specify which dependencies shall not be optimized away when a production build is built. Maybe there is something similar for Flutter.

By any chance were you able to reproduce the crash on your device when downloading from the Play Store or do you see it in your bug tracker. Maybe from a device name “TrendMicro”. That’s a security company and they look for malicious apps automatically. I see these exceptions and ignore them:
Caused by java.lang.UnsatisfiedLinkError: No implementation found for long com.couchbase.lite.internal.database.sqlite.SQLiteConnection.nativeOpen

1 Like

I think you might be right - I’m using Proguard for my Flutter application too and I didn’t omit couchbase from the optimization.

Looks like it’s working when I’m testing the appbundle. Great catch!

I’ll release on play store to make sure it’s all good!

2 Likes

Also, I haven’t seen anything related to TrendMicro

Ok - solution was to fix ProGuard! Great suggestion @benjamin_glatzeder !

1 Like