Android开发中常见的10个错误
2017-06-04 21:37
323 查看
Android开发中遇到的常见错误
R.java消失或解析异常解决方法:查看res中资源文件,图片,xml等。比如图片文件名不能有大写不能有空格。解决错误之后执行Project->clean就可以了。
Unable to resolve target ‘android-2.14’
安装低版本的api,再default.properties 这个文件中把target=android-2.14 改成 target=android-7就没有问题了。
ActivityManager: Warning: Activity not started, its current task has been brought to the front
解决方法:该手机已经启动了相同名字的应用,关闭之后再试.
使用Intent时出现另一个活动未发现的异常(ActivityNotFoundException)
解决方法:在AndroidManifest.xml中再加一个
Couldn’t read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.编程的中途改变表的字段,实际字段并没有改变
解决方法:写对大小写或卸载当前版本,再安装调试。
首次进入带有EditText的Activity不自动弹出软键盘,再次点击才弹出。
解决方法:只有设置manifest的方法有用,在activity的设置中添加:
[html] view plaincopyprint? android:windowSoftInputMode="adjustPan|stateHidden"
7.启动android模拟器时候如果提示:Failed to install on device ‘emulator-5554′: timeout
解决方法:eclipse -> window -> Preferences -> Android -> DDMS -> ADB connection time out(ms).把这个时间设置的长一些,默认是5秒即5000ms, 我改成10秒就ok了。
这样就不用每次重启模拟器了。
8.No Launcher activity found!
The launch will only sync the application package on the device!
解决方法:在AndroidManifest.xml 中添加
<category android:name=”android.intent.category.LAUNCHER” />
9.
图片显示信息为:Android SDK要求ADT(Android Developer Toolkit)版本在20.0.0或以上版本,检测到当前版本为18.0.0,请更新最新的ADT。
出现这样的提示,根本原因是Eclipse启动时检测E:Program Filesandroid-sdk-windowstoolslibplugin.prop文件 文件内容为:
plugin.version=20.0.0 # end plugin.prop
这时候我们只需要改成:
plugin.version=18.0.0 # end plugin.prop
再重新启动下Eclipse,就解决了这个问题。
10.修改了Android项目的最小SDK版本之后出现很多stysle文件找不到
解决方法:
compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "net.mmloo2014.android" minSdkVersion 14 targetSdkVersion 23 }
compileSdkVersion 是多少版本的
那么compile ‘com.android.support:appcompat-v7:23.2.1’ 就是什么版本的。
作者:陈理
链接:Android开发中常见的10个错误
相关文章推荐
- Android开发中常见的10个错误
- eclipse开发android常见错误总结
- 谷歌Android开发常见错误及技巧
- Android开发-----NDK开发中的一些常见错误及解决办法
- Android开发常见错误汇总
- Android开发常见错误汇总
- ANDROID开发之http调试常见错误
- Android开发常见错误-ing
- Android开发常见错误汇总
- Android开发常见错误收集
- Android开发常见错误及技巧
- Android 下arcgis开发学习第二天--扫清常见错误
- 配置Android开发环境常见错误解决办法(陆续添加)“your project contains error(s),please fix them before running your appli
- 安卓-开发常见错误之AndroidManifest.xml file missing
- Android开发常见错误及技巧
- Android开发常见错误,经常会碰到
- eclipse开发Android程序时一些常见问题与错误提示
- android开发之常见编译错误(一)
- android 开发,应用汇常见错误列表
- Android 开发常见错误 及 解决办法