I Use Couchbase lite 2.0.0 ,when install at real mobile,it have this error(it have no error at emulator):
E/DB: Cannot load native library
E/art: No implementation found for void com.couchbase.litecore.C4Log.setLevel(java.lang.String, int) (tried Java_com_couchbase_litecore_C4Log_setLevel and Java_com_couchbase_litecore_C4Log_setLevel__Ljava_lang_String_2I)
environment:
Win10 x64,android studio 3.0.1,test real Mobile(it have no error at emulator).
oh,my god,couchbase lite just can run at arm & x86 cpu? I am at china,i use huawei mobile,and it’s cpu is Hisilicon,it’s huawei’s cpu.
Huawei mobile phones are very popular in China. In this case, can’t I use couchbaselite as a local database?
It looks like whatever CPU architecture the device is, it isn’t compatible with the ARM architecture we build for, so JNI can’t load it. You should try to look up what exact CPU architecture your device has, i.e. ARMv7 etc.
But my app is for Internet users. I can’t control the user’s mobile phone architecture. Can’t you compile a version that is not related to the platform architecture?
This shows that all of their processors listed are either ARMv7 or ARMv8 (arm64) which are both supported architectures. Which processor is showing the error for you?
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void com.couchbase.litecore.C4Log.setLevel(java.lang.String, int) (tried Java_com_couchbase_litecore_C4Log_setLevel and Java_com_couchbase_litecore_C4Log_setLevel__Ljava_lang_String_2I)
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void com.couchbase.litecore.C4Log.setLevel(java.lang.String, int) (tried Java_com_couchbase_litecore_C4Log_setLevel and Java_com_couchbase_litecore_C4Log_setLevel__Ljava_lang_String_2I)
at com.couchbase.litecore.C4Log.setLevel(Native Method)
at com.couchbase.lite.internal.support.Log.enableLogging(Log.java:431)
at com.couchbase.lite.internal.support.Log.setLogLevel(Log.java:400)
at com.couchbase.lite.AbstractDatabase.(AbstractDatabase.java:69)
at com.secyang.pbdb.base.DMM.(DMM.java:59)
at com.secyang.pbdb.base.DMM.getSharedInstance(DMM.java:204)
the code:
protected DMM(Context context, boolean isGuest) {
loginUserId=“Tom”;
if (isGuest) {
DatabaseConfiguration config = new DatabaseConfiguration(context);
// File folder = new File(String.format("%s/guest", context.getFilesDir()));
config.setDirectory(String.format("%s/guest", context.getFilesDir()));
try {
database = new Database("test", config);
} catch (CouchbaseLiteException e) {
e.printStackTrace();
}
} else {
File dbFile = new File(context.getFilesDir(), "travel-sample.cblite2");
if (!dbFile.exists()) {
DMM.installPrebuiltDatabase(context, "travel-sample.cblite2.zip");
}
DatabaseConfiguration config = new DatabaseConfiguration(context);
try {
database = new Database("travel-sample", config);
createFTSQueryIndex();
} catch (CouchbaseLiteException e) {
e.printStackTrace();
}
}
}
public static DMM getSharedInstance(Context context, boolean isGuest) {
if (null == instance) {
synchronized (SynObject) {
if (null == instance) {
instance = new DMM(context, isGuest);
}
}
}
return instance;
}
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.yang.pb, PID: 13083
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.yang.pb-1/base.apk”],nativeLibraryDirectories=[/data/app/com.yang.pb-1/lib/arm, /data/app/com.yang.pb-1/base.apk!/lib/armeabi, /system/lib, /vendor/lib, /system/vendor/lib, /product/lib]]] couldn’t find “libLiteCoreJNI.so”
at java.lang.Runtime.loadLibrary0(Runtime.java:989)
at java.lang.System.loadLibrary(System.java:1533)
at com.benmu.wx.App.onCreate(App.java:120)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1028)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5658)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)