jeasonlzy / okhttp-OkGo

OkGo - 3.0 震撼来袭,该库是基于 Http 协议,封装了 OkHttp 的网络请求框架,比 Retrofit 更简单易用,支持 RxJava,RxJava2,支持自定义缓存,支持批量断点下载管理和批量上传管理功能
Apache License 2.0
10.6k stars 2.55k forks source link

Failed to open database '/data/user/0/com.*.*/databases/okgo.db'. #987

Open hh7181521 opened 2 years ago

hh7181521 commented 2 years ago

初始化代码

private void initOkGo() {
    //okGo网络框架初始化和全局配置
    OkHttpClient.Builder builder = new OkHttpClient.Builder();

// builder.cookieJar(new CookieJarImpl(new SPCookieStore(this))); //使用sp保持cookie,如果cookie不过期,则一直有效 builder.cookieJar(new CookieJarImpl(new DBCookieStore(this)));//使用数据库保持cookie,如果cookie不过期,则一直有效 //builder.cookieJar(new CookieJarImpl(new MemoryCookieStore())); //使用内存保持cookie,app退出后,cookie消失 //设置请求头 HttpHeaders headers = new HttpHeaders(); // headers.put("commonHeaderKey1", "commonHeaderValue1"); //header不支持中文,不允许有特殊字符 // headers.put("commonHeaderKey2", "commonHeaderValue2"); //设置请求参数 HttpParams params = new HttpParams(); params.put("c", "Visitor"); //param支持中文,直接传,不要自己编码 params.put("a", "openDoorRecord"); /*

04-28 22:44:00.042 234 234 E hwcomposer-drm: hwc_prepare: display=0, connector[1] is disconnect type=HDMI-A 04-28 22:44:00.042 234 234 E hwc-drm-composition: Plan: crtc is null 04-28 22:44:00.042 234 234 E hwc-drm-composition: DisableUnusedPlanes: crtc is null 04-28 22:44:11.463 602 613 I ActivityManager: Process com.jndv.parking (pid 1493) has died 04-28 22:44:11.463 602 613 D ActivityManager: cleanUpApplicationRecord -- 1493 04-28 22:44:11.481 1536 1536 E art : setrlimit(RLIMIT_CORE) failed for pid 1536: Operation not permitted 04-28 22:44:11.486 602 613 I ActivityManager: Start proc 1536:com.jndv.parking/1000 for activity com.jndv.parking/.IntelligentParkNewActivity 04-28 22:44:11.591 1536 1536 W ContextImpl: Failed to ensure /data/user/0/com.jndv.parking/cache: mkdir failed: EACCES (Permission denied) 04-28 22:44:11.641 1536 1536 E linker : library "/system/lib/librk_vpuapi.so" ("/system/lib/librk_vpuapi.so") needed or dlopened by "/data/app/com.jndv.parking-1/lib/arm/libvpu.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.jndv.parking-1/lib/arm:/system/fake-libs:/data/app/com.jndv.parking-1/base.apk!/lib/armeabi-v7a", permitted_paths="/data:/mnt/expand:/data/data/com.jndv.parking"] 04-28 22:44:11.643 1536 1536 I mpi : mpp version: a57fd68 author: Ding Wei [vdpu2]: fix bug: set ref list 04-28 22:44:11.644 1536 1536 I mpp_rt : NOT found ion allocator 04-28 22:44:11.644 1536 1536 I mpp_rt : found drm allocator 04-28 22:44:11.658 1536 1536 W ContextImpl: Failed to ensure /data/user/0/com.jndv.parking/shared_prefs: mkdir failed: EACCES (Permission denied) 04-28 22:44:11.676 1536 1536 W ContextImpl: Failed to ensure /data/user/0/com.jndv.parking/files: mkdir failed: EACCES (Permission denied) 04-28 22:44:11.683 1536 1536 E xcrash : NativeHandler init failed 04-28 22:44:11.695 1536 1559 E SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/com.jndv.parking/shared_prefs/jndv_park.xml 04-28 22:44:11.712 1536 1536 W ContextImpl: Failed to ensure /data/user/0/com.jndv.parking/databases: mkdir failed: EACCES (Permission denied) 04-28 22:44:11.713 1536 1536 E SQLiteLog: (14) cannot open file at line 32456 of [bda77dda96] 04-28 22:44:11.713 1536 1536 E SQLiteLog: (14) os_unix.c:32456: (13) open(/data/user/0/com.jndv.parking/databases/okgo.db) - 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: Failed to open database '/data/user/0/com.jndv.parking/databases/okgo.db'. 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:808) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:793) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:652) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:289) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.lzy.okgo.db.BaseDao.openWriter(BaseDao.java:58) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.lzy.okgo.db.BaseDao.(BaseDao.java:50) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.lzy.okgo.db.CookieManager.(CookieManager.java:50) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.lzy.okgo.db.CookieManager.getInstance(CookieManager.java:42) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.lzy.okgo.cookie.store.DBCookieStore.(DBCookieStore.java:54) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.jndv.baselibrary.BaseApplication.initOkGo(BaseApplication.java:97) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.jndv.baselibrary.BaseApplication.onCreate(BaseApplication.java:84) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5425) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.app.ActivityThread.-wrap2(ActivityThread.java) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1551) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.os.Handler.dispatchMessage(Handler.java:102) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.os.Looper.loop(Looper.java:154) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at android.app.ActivityThread.main(ActivityThread.java:6141) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at java.lang.reflect.Method.invoke(Native Method) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 04-28 22:44:11.715 1536 1536 E SQLiteDatabase: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 04-28 22:44:11.716 1536 1536 D AndroidRuntime: Shutting down VM 04-28 22:44:11.722 1536 1536 D JavaCrashUtils: BOARD : rk30sdk 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: BOOTLOADER : unknown 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: BRAND : Android 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: CPU_ABI : armeabi-v7a 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: CPU_ABI2 : armeabi 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: DEVICE : rk3399_jnsx 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: DISPLAY : rk3399_jnsx-userdebug 7.1.2 NHG47K eng.jndv.20201103.152704 test-keys 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: FINGERPRINT : Android/rk3399_jnsx/rk3399_jnsx:7.1.2/NHG47K/jndv11031527:userdebug/test-keys 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: HARDWARE : rk30board 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: HOST : ubuntu 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: ID : NHG47K 04-28 22:44:11.723 1536 1536 D JavaCrashUtils: IS_DEBUGGABLE : true 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: IS_EMULATOR : false 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: MANUFACTURER : rockchip 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: MODEL : rk3399-jnsx 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: PERMISSIONS_REVIEW_REQUIRED : false 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: PRODUCT : rk3399_jnsx 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: RADIO : unknown 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: SERIAL : GGW785J8CH 04-28 22:44:11.724 1536 1536 D JavaCrashUtils: SUPPORTED_32_BIT_ABIS : [Ljava.lang.String;@8ecb4cc 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: SUPPORTED_64_BIT_ABIS : [Ljava.lang.String;@da75315 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: SUPPORTED_ABIS : [Ljava.lang.String;@2ccf62a 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: TAG : Build 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: TAGS : test-keys 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: TIME : 1604388424000 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: TYPE : userdebug 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: UNKNOWN : unknown 04-28 22:44:11.725 1536 1536 D JavaCrashUtils: USER : jndv 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: SUPPORTED_64_BIT_ABIS=[Ljava.lang.String;@da75315 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: versionCode=103 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: BOARD=rk30sdk 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: BOOTLOADER=unknown 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: TYPE=userdebug 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: ID=NHG47K 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: TIME=1604388424000 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: BRAND=Android 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: TAG=Build 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: HARDWARE=rk30board 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: SERIAL=GGW785J8CH 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: SUPPORTED_ABIS=[Ljava.lang.String;@2ccf62a 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: CPU_ABI=armeabi-v7a 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: IS_DEBUGGABLE=true 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: RADIO=unknown 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: MANUFACTURER=rockchip 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: IS_EMULATOR=false 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: SUPPORTED_32_BIT_ABIS=[Ljava.lang.String;@8ecb4cc 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: TAGS=test-keys 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: CPU_ABI2=armeabi 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: UNKNOWN=unknown 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: PERMISSIONS_REVIEW_REQUIRED=false 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: USER=jndv 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: FINGERPRINT=Android/rk3399_jnsx/rk3399_jnsx:7.1.2/NHG47K/jndv11031527:userdebug/test-keys 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: HOST=ubuntu 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: versionName=1.5.1 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: PRODUCT=rk3399_jnsx 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: DISPLAY=rk3399_jnsx-userdebug 7.1.2 NHG47K eng.jndv.20201103.152704 test-keys 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: MODEL=rk3399-jnsx 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: DEVICE=rk3399_jnsx 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: java.lang.RuntimeException: Unable to create application com.jndv.baselibrary.BaseApplication: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5428) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.app.ActivityThread.-wrap2(ActivityThread.java) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1551) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.os.Handler.dispatchMessage(Handler.java:102) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.os.Looper.loop(Looper.java:154) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.app.ActivityThread.main(ActivityThread.java:6141) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at java.lang.reflect.Method.invoke(Native Method) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:808) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:793) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:652) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:289) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.lzy.okgo.db.BaseDao.openWriter(BaseDao.java:58) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.lzy.okgo.db.BaseDao.(BaseDao.java:50) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.lzy.okgo.db.CookieManager.(CookieManager.java:50) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.lzy.okgo.db.CookieManager.getInstance(CookieManager.java:42) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.lzy.okgo.cookie.store.DBCookieStore.(DBCookieStore.java:54) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.jndv.baselibrary.BaseApplication.initOkGo(BaseApplication.java:97) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at com.jndv.baselibrary.BaseApplication.onCreate(BaseApplication.java:84) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5425) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: ... 8 more 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:808) 04-28 22:44:11.727 1536 1536 E JavaCrashUtils: at android.database.sqlite.SQLiteDatabas 04-28 22:44:11.736 1536 1536 E JavaCrashUtils: Unable to create application com.jndv.baselibrary.BaseApplication: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database