Android exception and Error Accumulation

Source: Internet
Author: User
Please post, but please note the address: Thank you

1. socketexception: noroute to host

Just re-open the WiFi.


Failed to install xxx.apk on device '040398FE1701701F': Unable to open sync connection! Unable to open sync connection!Launch canceled!

Enable USB debugging again.


res\values\style.xml:44:error: Error retrieving parent for item: No resource found that matches the given name 'android:WindowTitleBackground'

In Style. xml

<style name="iWindowTitleBackground"parent="android:WindowTitleBackground">           <item name="android:background">@drawable/title_bar</item>       </style>

Set"Android: windowtitlebackground"> Changed"* Android: windowtitlebackground">.



[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!

Delete this project on your phone.


12-29 13:59:31.929: ERROR/AndroidRuntime(5594): Caused by: 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 13:59:31.929: ERROR/AndroidRuntime(5594):     at 13:59:31.929: ERROR/AndroidRuntime(5594):     ... 12 more

After onresume () is rewritten, super. onresume () is deleted. This exception can be added.

6. Sometimes the mobile phone cannot be connected and the ADB needs to be restarted.


Caused by: java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams

Recently, when code is used in Android to dynamically change the height of a layout (component), an exception occurs in class conversion as shown in the question. I checked it online, as shown below:

These supply parameters toParentOf this view specifying how it shoshould be arranged. There are using 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.

I understand it in this way. If you want to add a view to another layout, you must set the layout parameters of this view to the layout parameter type used by its parent class. That is, to dynamically change the height of a component in the Code, the layout parameter type should be the layout parameter type used by its parent class.

View has set layoutparams, and its parent control also needs to be set

8. An exception is reported when three or more tabs are added to the tabhost.

Caused by: java.lang.IllegalArgumentException: you must specify a way to create the tab contentat android.widget.TabHost.addTab(

According to the tabhost source code, we can see that mcontentstrategy = NULL.

Original statement

TabSpec ts1 = tabhost.newTabSpec(TAB1).setIndicator(TAB1);ts1.setContent(new Intent(BottomMenu_ArrowTop.this, TestViewFlipper.class));tabhost.addTab(ts1);

Written after Rewriting

tabhost.addTab(tabhost.newTabSpec(TAB1)                .setIndicator(TAB1)                .setContent(new Intent(this,TestViewFlipper.class)));

9. JNI method call error

02-28 23:02:52.218: ERROR/AndroidRuntime(27159): java.lang.UnsatisfiedLinkError: unimplementedStringFromJNI

There is no unimplementedstringfromjni method in JNI.

10. Custom Controls

03-19 10:40:40.905: ERROR/AndroidRuntime(12911): Caused by: android.view.InflateException: Binary XML file line #244: Error inflating class ScrollTextView

244 lines of XML file, caused by incorrect package name

11. Resource not found

04-13 11:06:00.460: ERROR/AndroidRuntime(25002): android.content.res.Resources$NotFoundException: String resource ID #0x1

At first, I thought it was strange that I couldn't do it after I cleaned it. Later I found that it was in textview. settext (position); It should be string, and the int written at that time

12. viewpager exception

Viewpager throws an exception after SDK upgrade

E/AndroidRuntime(6997): Caused by: java.lang.ClassNotFoundException: in loader dalvik.system.PathClassLoader[/data/app/cn.cmcc.brower.apk]

Place the third-party package in libs under the project directory, right-click the libs package, and set build
Select use as source folder in path, and then add the jar package to build path. Then, OK.

13. Unable to connect to the mobile phone

ADB server didn't ACK* failed to start daemon *

Turn Off 360 and restart eclipse. If the problem persists, uninstall pods and restart eclipse.

14. The illegalstateexception is invalid.

java.lang.IllegalStateException The specified child already has a parent. You must call removeView() on the child's parent first.

Adding a view instance to two la s throws this exception. You can add a new view to the second layout.

15. Prevent proguard from confusing third-party jar packages

-Keep public class package name .**{*;}

16. Android SDK manager cannot be updated

We only need to configure the hosts file and add the following sentence at the end of the file:

In Windows, the hosts file is located at: c: \ windows \ system32 \ drivers \ etc. Find the file and open it in text format. Add the above sentence and close it after saving it, restart eclipse to open Android SDK manager. OK!

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.