Android开发--一些错误集合

来源:互联网 发布:系统温度监控软件 编辑:程序博客网 时间:2024/06/14 04:31

把最近做android开发遇到的一些错误整理到这里

1.ListView与SimpleCursorAdapter出现colunm _id does not exists错误

今天使用sqlite绑定数据到listview时出现了java.lang.IllegalArgumentException: column '_id' does not exist,找了很久才发现查询出来的数据必须有_id这列才不会出错,于是把查询语句改为select  id as _id,phoneNumber from info即可(我自己定义了一个id),就可以了
其中,我曾试着把我数据库里面定义的id改为_id(查询语句为select  * from info或者select   _id,phoneNumber from info)或者把id的定义删除(select  * from info,这种方法也行不通。
这个有个外文的链接
http://stackoverflow.com/questions/3359414/android-column-id-does-not-exist
2.更新Eclipse出现以下错误

An error occurred while collecting items to be installed
session context was
:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,com.android.ide.eclipse.adt,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.adt.package,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.base,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.ddms,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.gldebugger,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.hierarchyviewer,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.ndk,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.traceview,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,overlay.com.android.ide.eclipse.adt.overlay,21.1.0.v201302060044-569685
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.adt,21.1.0.v201302060044-569685
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.ddms,21.1.0.v201302060044-569685
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.gldebugger,21.1.0.v201302060044-569685
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.hierarchyviewer,21.1.0.v201302060044-569685
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.ndk,21.1.0.v201302060044-569685
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.traceview,21.1.0.v201302060044-569685

http://stackoverflow.com/questions/15376948/updating-eclipse-sdk-error
我按照上面连接中提供的方案试一试,发现不行,然后再网上找了不少资料,发现其中有个原因会导致这个错误,即无法连接到更新服务器,既然无法连接,有可能是服务器出了问题,也有可能连接被电脑里面的防火墙或者杀软阻止了,于是,我尝试把系统防火墙关闭,杀软关闭,结果更新成功