Rejecting re-init on previously-failed class java.lang.Class<org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper>: java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sqlcipher/database/SQLiteOpenHelper;
at void com.lanren.lanrenbook.dao.DbHelper.<init>() (DbHelper.java:14)
at com.lanren.lanrenbook.dao.DbHelper com.lanren.lanrenbook.dao.DbHelper.getInstance() (DbHelper.java:27)
at void com.lanren.lanrenbook.presenter.impl.SearchPresenterImpl$2.subscribe(io.reactivex.ObservableEmitter) (SearchPresenterImpl.java:63)
at void io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(io.reactivex.Observer) (ObservableCreate.java:40)
at void io.reactivex.Observable.subscribe(io.reactivex.Observer) (Observable.java:10910)
at void io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run() (ObservableSubscribeOn.java:96)
at void io.reactivex.Scheduler$DisposeTask.run() (Scheduler.java:452)
at void io.reactivex.internal.schedulers.ScheduledRunnable.run() (ScheduledRunnable.java:61)
at java.lang.Object io.reactivex.internal.schedulers.ScheduledRunnable.call() (ScheduledRunnable.java:52)
at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:301)
at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
at void java.lang.Thread.run() (Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "net.sqlcipher.database.SQLiteOpenHelper" on path: DexPathList[[zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/base.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_dependencies_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_resources_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_slice_0_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_slice_1_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_slice_2_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_slice_3_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_slice_4_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6m74mApE3sUl1w==/split_lib_slice_5_apk.apk", zip file "/data/app/com.lanren.lanrenbook-gRFbydhc6
解决办法:关闭Android Studio中的Instant Run功能。File -> Setting -> Build,Execution,Deployment -> Instant Run,取消勾选。
亲测ok