Stackoverflow上有很多开放的线程(通过所有但非线程给我正确的答案来解决这个问题。)
在各种操作系统2.3.6,4.0.3上出现此错误(因此绝对与Android操作系统版本无关)
场景1:应用版本2.0已在市场上供用户下载
第1步 - 用户下载应用程序和无错误。
场景2:应用版本2.0已在市场上供用户下载
第1步 - 用户已有应用程序1.5的先前版本(市场要求用户更新并且用户执行更新)。市场在应用程序启动时卸载并安装新版本和系统崩溃,并出现以下错误..
I/Database(31396): sqlite returned: error code = 14, msg = cannot open file at line 27205 of [42537b6056]
E/Database(31396): sqlite3_open_v2("/data/data/com.XXXXX.XXXXX/databases/XXX", &handle, 2, NULL) failed
W/b (31396): could not open database XXX - unable to open database file
W/b (31396): copying database from assets...
W/b (31396): extracting file: 'XXX'...
E/b (31396): Couldn't open XXX for writing (will try read-only):
E/b (31396): com.a.a.a: Missing databases/XXX.zip file in assets or target folder not writable
E/b (31396): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
E/b (31396): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
E/b (31396): at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
E/b (31396): at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
E/b (31396): at java.io.FileOutputStream.<init>(FileOutputStream.java:144)
E/b (31396): at com.a.a.b.b(Unknown Source)
E/b (31396): at com.a.a.b.a(Unknown Source)
E/b (31396): at com.a.a.b.getWritableDatabase(Unknown Source)
E/b (31396): at com.a.a.b.getReadableDatabase(Unknown Source)
E/b (31396): at com.XXXXX.XXXXX.x.a(Unknown Source)
E/b (31396): at com.XXXXX.XXXXX.ay.a(Unknown Source)
E/b (31396): at com.XXXXX.XXXXX.ay.doInBackground(Unknown Source)
E/b (31396): at android.os.AsyncTask$2.call(AsyncTask.java:185)
E/b (31396): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
E/b (31396): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
E/b (31396): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
E/b (31396): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
E/b (31396): at java.lang.Thread.run(Thread.java:1019)
I/Database(31396): sqlite returned: error code = 14, msg = cannot open file at line 27205 of [42537b6056]
E/Database(31396): sqlite3_open_v2("/data/data/com.XXXXX.XXXXX/databases/XXX", &handle, 1, NULL) failed
W/System.err(31396): android.database.sqlite.SQLiteException: unable to open database file
W/System.err(31396): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
W/System.err(31396): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1857)
W/System.err(31396): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:824)
W/System.err(31396): at com.a.a.b.getReadableDatabase(Unknown Source)
W/System.err(31396): at com.XXXXX.XXXXX.x.a(Unknown Source)
W/System.err(31396): at com.XXXXX.XXXXX.ay.a(Unknown Source)
W/System.err(31396): at com.XXXXX.XXXXX.ay.doInBackground(Unknown Source)
W/System.err(31396): at android.os.AsyncTask$2.call(AsyncTask.java:185)
W/System.err(31396): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
W/System.err(31396): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
W/System.err(31396): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
W/System.err(31396): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
W/System.err(31396): at java.lang.Thread.run(Thread.java:1019)
场景3:应用版本2.0已在市场上供用户下载
第1步 - 用户已经拥有应用程序1.5的先前版本(自行卸载应用程序,然后进入市场并安装应用程序。无错误
我很困惑为什么在场景2中抛出异常。与安装和卸载相比,升级是否有所不同以及为什么它说目标文件夹不可写
答案 0 :(得分:0)
我们进一步分析并得出结论,这是因为其中一位开发人员在Manifest文件中更新了sharedUserId。经验教训----
请勿更新已发布的应用程序的sharedUserId 。