0

我使用 greendao 时遇到错误,并且在 gradle 文件中正确导入了 sqlcipher 的依赖项,我还导入了 armeabi、armeabi-v7a 和 x86 本机库,但无法弄清楚如何添加 mips,因为我可以'找不到它,我的模拟器是 mips 系统映像所以这个错误来了,我想是的

请帮帮我

java.lang.UnsatisfiedLinkError: Couldn't load stlport_shared: findLibrary returned null
                                                             at java.lang.Runtime.loadLibrary(Runtime.java:365)
                                                             at java.lang.System.loadLibrary(System.java:535)
                                                             at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:173)
                                                             at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:169)
                                                             at org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper.<init>(DatabaseOpenHelper.java:173)
                                                             at org.greenrobot.greendao.database.DatabaseOpenHelper.checkEncryptedHelper(DatabaseOpenHelper.java:120)
                                                             at org.greenrobot.greendao.database.DatabaseOpenHelper.getEncryptedWritableDb(DatabaseOpenHelper.java:132)
                                                             at com.sqltest.App.onCreate(App.java:19)
                                                             at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:369)
                                                             at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
                                                             at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151)
                                                             at android.app.ActivityThread.access$1300(ActivityThread.java:130)
                                                             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
                                                             at android.os.Handler.dispatchMessage(Handler.java:99)
                                                             at android.os.Looper.loop(Looper.java:137)
                                                             at android.app.ActivityThread.main(ActivityThread.java:4745)
                                                             at java.lang.reflect.Method.invokeNative(Native Method)
                                                             at java.lang.reflect.Method.invoke(Method.java:511)
                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                                                             at dalvik.system.NativeStart.main(Native Method)

应用程序.java

public class App extends Application {
/** A flag to show how easily you can switch from standard SQLite to the encrypted SQLCipher. */
public static final boolean ENCRYPTED = true;

private DaoSession daoSession;

@Override
public void onCreate() {
    super.onCreate();

    DevOpenHelper helper = new DevOpenHelper(this, ENCRYPTED ? "notes-db-encrypted" : "notes-db");
    Database db = ENCRYPTED ? helper.getEncryptedWritableDb("super-secret") : helper.getWritableDb();
    daoSession = new DaoMaster(db).newSession();
}

public DaoSession getDaoSession() {
    return daoSession;
 }
}

错误来了

Database db = ENCRYPTED ? helper.getEncryptedWritableDb("super-secret") : helper.getWritableDb();
4

1 回答 1

0

请仔细检查 greendao 依赖项的版本。它必须是 3.0.1。

于 2016-07-16T12:40:19.733 回答