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/] 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 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.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)

I’m using flutter for development and [](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.

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

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!

1 Like

Also, I haven’t seen anything related to TrendMicro

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

1 Like