数据库处理在Android 2.2.1(Desire HD 1.72.405.3)上停止工作 [英] Database handling stopped working on Android 2.2.1 (Desire HD 1.72.405.3)

查看:53
本文介绍了数据库处理在Android 2.2.1(Desire HD 1.72.405.3)上停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,在HTC Desire HD上将OTA更新至2.2.1(1.72.405.3)后,该文章就无法在HTC Desire HD上运行.在更新之前,它可以在Desire HD上运行,而且我无法在运行2.1、2.2的实际设备以及运行所有版本的模拟器中重现该错误.

For some reason the database handling solution described in this article doesn't work on the HTC Desire HD after it got the OTA update to 2.2.1 (1.72.405.3). It worked on Desire HD before the update and I've failed to reproduce the error on actual devices running 2.1, 2.2 as well as in emulator running all versions.

不幸的是,您无法为运行Android 2.2.1的模拟器创建AVD,并且我尝试了基于2.2.1的ROM(我拥有扎根的普通HTC Desire),但我的应用程序也能正常运行.所以问题是,如果它以某种方式使用了Android SDK,那不是突然就引起问题了吗?

Unfortunately you can't created a AVD for emulator running Android 2.2.1 and I've tried a ROM based on 2.2.1 (I have a rooted ordinary HTC Desire) but my application works without problem on it as well. So the question is if it's using the Android SDK in some way it shouldn't that all of a sudden cause the problem?

我知道这是一个非常具体的问题,但是由于报告此问题的开发人员多于我,而且您无法创建AVD,因此我希望该问题已被接受,并且希望有人知道可能会导致该问题的原因.问题.

I know this is a very specific issue but since more developers than me reporting the problem as well as the fact that you can't create an AVD I hope the question is accepted and I hope someone have a clue what might causing the problem.

以下是用户发送到我的Market帐户的堆栈跟踪:

Here's a stack trace sent to my Market account by user:

Caused by: android.database.sqlite.SQLiteDiskIOException: disk I/O error
at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:2049)
at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1917)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:889)
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:168)
at com.MyApp.DataBaseHelper.createDataBase(DataBaseHelper.java:81)
at com.MyApp.InitialActivity.onCreate(InitialActivity.java:33)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2797)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1066)  

相关方法可以在pastebin中找到.由于只能包含一个超链接,因此可以在下面的评论中找到该链接.请注意,在堆栈跟踪中找到的第81行是pastebin的第10行.

Related methods can be found at pastebin. Since only one hyperlink can be included link could be found in comments below. Note that line 81 found in stack trace is line 10 at pastebin.

推荐答案

我似乎终于可以在Desire HD的Android 2.2.1上运行我的应用了.我没有机会亲自对其进行调试,以确切地找出导致问题的原因.

I finally seem to have got my app to work on Android 2.2.1 on Desire HD. I haven’t had the chance to debug on it personally to try out exactly what’s causing the problem.

弹出的一个想法是数据库文件所在位置的硬编码路径. DB_PATH ="/data/data/YOUR_PACKAGE/databases/";

One thought that popped up is the hard coded path to where the database file is located. DB_PATH = "/data/data/YOUR_PACKAGE/databases/";

我想这条路径可能在Desire HD的Android 2.2.1上无效.我将此路径交换为: Environment.getDataDirectory()+"/data/YOUR_PACKAGE/databases/" + DB_NAME;

I guess it is possible that this path isn’t valid on Android 2.2.1 for Desire HD. I exchanged this path with: Environment.getDataDirectory() + "/data/YOUR_PACKAGE/databases/" + DB_NAME;

当我有机会亲自在实际的手机上进行测试时,我会尝试找出问题所在.如果有人测试了此解决方案,请让我知道它是否可以解决.

I’ll try to pin point the issue when I had the chance to test on the actual phone myself. If anyone test this solution, please let me know if it solves it.

这篇关于数据库处理在Android 2.2.1(Desire HD 1.72.405.3)上停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆