The summary of Eclipse error and corresponding processing method in Android development _android

Source: Internet
Author: User

In this paper, the eclipse error and its corresponding processing method in the development of Android are summarized in detail. Share to everyone for your reference, specific as follows:

Error 1:

Conversion to Dalvik format failed with error 1

The reason for the error: The reason is that I accidentally imported Java Mina in the Android project, the result of a running program reported this error.
Workaround: Remove the Mina package used in Java and just OK.

Summary: In the future when you encounter this error, remember to remind yourself that it may be due to their own guide to the wrong package.

Attached: Online Other processing methods: "Lost the Android system library or conversion to Dalvik format failed with error 1 Error resolution"

Error 2:
Exception in thread "main" Java.lang.noclassdeffounderror:org/slf4j/loggerfactory

The reason for the error:

The exception occurs inside the main thread. This class is not found in the Javalang bag. That is, there are no packages to import accordingly.

This error, which I found in Java to implement a communication conversation with Mina, was due to the fact that the following two packages were not imported.

Workaround: Import the package Slf4j-api-1.6.4.jar and Slf4j-nop-1.6.4.jar two packages.

Android and Java inside the Mina bag I put in my blog resources have, want to use words can go to download.

Summary: Remember to import the package problem, especially when you are not with the Java package, you must remember. There is a mistake, directly copied to Google, find solutions.

Error 3:

[2012-05-18 20:27:23-Here is your project name] The connection to ADB are down, and a severe error has occured.
[2012-05-18 20:27:23-...] You must restart ADB and Eclipse.
[2012-05-18 20:27:23-... Please ensure the ADB is correctly located in ' E:\Program Files\andriod_sdk\platform-tools\adb.exe ' and can be executed.

The reason for the error: Because the hint is that the ADB connection has been closed, a service error has occurred. That is, you should close the ADB process and start eclipse anew.

Workaround: Open Task Manager, end the Adb.exe process directly in the process, note that there may be multiple adb.exe processes, and remember to close them all.

Summary: When you do not know how to deal with the error, copied to Google should be able to solve the problem.

Attach: Other processing methods on the Internet: "The solution of the connection to ADB being down problem in Android programming"

Error 4:

Java.lang.NoClassDefFoundError:org.apache.mina.transport.socket.nio.NioSocketConnector

The reason for the error: Do not know yet????

Workaround: Create a new project, copy the contents of the past, and pay attention to the package name.

Question 5:

How does the Chinese annotation garbled in eclipse solve??

Solution: Do projects are usually encoded with UTF-8, Eclipse's default encoding is GBK, you are in the Menu bar window, select the Preferences option, the first general workspace, selected right there is a text file Encoding, the default is selected on GBK, choose Other, List optional, select the bottom of the UTF-8, after the application and then import or create the project will not appear garbled.

Question 6:

Eclipse Import Package prompts setting build path has encountered a problem
Tip: ' Setting build path ' has encountered a problem,could not write file D:\\workspace\aaa\.classpath

Error reason: is the path problem

Solution: Locate the hidden. classpath file in the project, and modify its hidden properties to be visible.
This type of error is common when you copy a Java project from a machine's eclipse workspace to another machine's eclipse work environment.

Question 7:

Java.lang.RuntimeException:Unable to instantiate activity ComponentInfo

Specific:

Java.lang.RuntimeException:Unable to instantiate activity componentinfo{com. Ipcamera/com. IpCamera.com.IpCamera.MainActivity}: Java.lang.ClassNotFoundException:com. IpCamera.com.IpCamera.MainActivity in Loader dalvik.system.pathclassloader[/data/app/com. IPCAMERA-1.APK]

Solution: Check the data, just know to lead in the project configuration file inside the path problem.

<activity
  android:label= "@string/app_name"
  android:name= ". Mainactivity ">
  <intent-filter >
    <action android:name=" Android.intent.action.MAIN "/>
    <category android:name= "Android.intent.category.LAUNCHER"/>
  </intent-filter>
</activity >
<activity

Should be the inside of the

Copy Code code as follows:
Android:name= ". Mainactivity ">

To
Copy Code code as follows:
Android:name= "com. Ipcamera.mainactivity ">

I hope this article will help you with the Android program.

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.