Android exception and Error Accumulation

Source: Internet
Author: User
Tags android sdk manager
Please post, but please note the address: http://blog.csdn.net/ethan_xue/ Thank you

1. java.net. socketexception: noroute to host

Just re-open the 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!

Enable USB debugging again.

3.

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">.

Reference: http://topic.csdn.net/u/20110830/15/f12f7679-8857-4010-ac6e-88b8f52244e8.html

4.

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

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

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.

7.

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(TabHost.java:219)

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: android.support.v4.view.ViewPager 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:

74.125.237.1 dl-ssl.google.com

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

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.