1. java.net.SocketException: Noroute to host
重新开一下wifi就可以了.
2.
Failed to install xxx.apk on device '040398FE1701701F': Unable to open sync connection! java.io.IOException: Unable to open sync connection! Launch canceled!
重新打开usb调试就可以了.
3.res\values\style.xml:44:error: Error retrieving parent for item: No resource found that matches the given name 'android:WindowTitleBackground'
Style.xml里
<style name="iWindowTitleBackground"parent="android:WindowTitleBackground"> <item name="android:background">@drawable/title_bar</item> </style>将 "android:WindowTitleBackground">改为 "*android:WindowTitleBackground">就可以了.
参照:http://topic.csdn.net/u/20110830/15/f12f7679-8857-4010-ac6e-88b8f52244e8.html
[2010-03-23 11:57:49 - Poc]Re-installation failed due to different application signatures. [2010-03-23 11:57:49 - Poc]You must perform a full uninstall of the application. WARNING: This will remove the application data! [2010-03-23 11:57:49 - Poc]Please execute 'adb uninstall com.xue.test' in a shell. [2010-03-23 11:57:49 - Poc]Launch canceled!
删除手机中的这个工程即可
5.
12-29 13:59:31.929: ERROR/AndroidRuntime(5594): Caused by: android.app.SuperNotCalledException: Activity {com.test.lthandmap/com.test.lthandmap.poisearch.PoiInfoListActivity} did not call through to super.onResume() 12-29 13:59:31.929: ERROR/AndroidRuntime(5594): at android.app.Activity.performResume(Activity.java:3858) 12-29 13:59:31.929: ERROR/AndroidRuntime(5594): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2127) 12-29 13:59:31.929: ERROR/AndroidRuntime(5594): ... 12 more
重写onResume()后,super.onResume()删掉了所导致这个异常,加上就可以了.
6.手机有时候连不上,需要重启adb
7.
Caused by: java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams
These supply parameters to the parent of this view specifying how it should be arranged. There are many subclasses of ViewGroup.LayoutParams, and these correspond to the different subclasses of ViewGroup that are responsible for arranging their children.
So basically, if you are adding a view to another, you MUST set the LayoutParams of the view to the LayoutParams type that the parent uses, or you will get a runtime error.
view设置了 LayoutParams,他的父控件也需要设置
8.TabHost添加3个及以上tab时报的异常
Caused by: java.lang.IllegalArgumentException: you must specify a way to create the tab content at android.widget.TabHost.addTab(TabHost.java:219)看TabHost源码可知mContentStrategy=null,所以改下写法
原来的写法
TabSpec ts1 = tabhost.newTabSpec(TAB1).setIndicator(TAB1); ts1.setContent(new Intent(BottomMenu_ArrowTop.this, TestViewFlipper.class)); tabhost.addTab(ts1);改写后的写法
tabhost.addTab(tabhost.newTabSpec(TAB1) .setIndicator(TAB1) .setContent(new Intent(this,TestViewFlipper.class)));
9.jni 方法调用错误
02-28 23:02:52.218: ERROR/AndroidRuntime(27159): java.lang.UnsatisfiedLinkError: unimplementedStringFromJNI在jni里没有unimplementedStringFromJNI方法
10.自定义控件
03-19 10:40:40.905: ERROR/AndroidRuntime(12911): Caused by: android.view.InflateException: Binary XML file line #244: Error inflating class ScrollTextView
xml文件的244行,包名错误导致的
11.resource not found
04-13 11:06:00.460: ERROR/AndroidRuntime(25002): android.content.res.Resources$NotFoundException: String resource ID #0x1
12.viewpager的异常
因sdk升级后viewpager抛出异常
E/AndroidRuntime(6997): Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewPager in loader dalvik.system.PathClassLoader[/data/app/cn.cmcc.brower.apk]
13.连不上手机
ADB server didn't ACK * failed to start daemon *关掉360,重启eclipse,未解决的话,卸载豌豆荚,重启eclipse
14.IllegalStateException 非法状态异常
java.lang.IllegalStateException The specified child already has a parent. You must call removeView() on the child's parent first.把一个View实例加入到两个布局会抛出这个异常,加到第二个布局时new一个view加进去就可以了
15.让proguard不混淆第三方jar包
-keep public class 包名.**{*;}
16.Android SDK Manager无法更新的解决
我们只需要配置一下hosts文件,在文件的末尾添加下面一句:
74.125.237.1 dl-ssl.google.com
windows系统中hosts文件的位置为:C:\Windows\System32\drivers\etc ,找到该文件并已文本形式打开,添加上面一句话,保存之后关闭,重启Eclipse打开Android SDK Manager,ok!
17.导入qq分享的官方demo的时候,因为没导入他的jar导致出现这样的错误
Build path contains duplicate entry:'gen'for project'sdkjs_sample'
18.Android sdk content loader 0%的解决方案
关闭Eclipse,删掉Eclipse WorkSpace下.metadata\.plugins\org.eclipse.core.resources\.projects文件夹下的所有内容,再重启Eclipse。