SoFunction
Updated on 2025-03-09

Summary of Eclipse error reporting and corresponding processing methods in Android development

This article summarizes the Eclipse error reporting and corresponding processing methods in Android development in more detail. Share it for your reference, as follows:

Error 1:

Conversion to Dalvik format failed with error 1

The reason for the error: The reason is that I accidentally imported more Java mina in the Android project, and the result was that the error was reported as soon as I ran the program.
Solution: Remove the mina package used in Java and it's OK.

Summary: When you encounter such an error in the future, remember to remind yourself that it may be because you have directed the wrong packet.

Attachment: Other online processing methods:Solution to the loss of Android system library or Conversion to Dalvik format failed with error 1

Error 2:
Exception in thread "main" : org/slf4j/LoggerFactory

Reason for the error:

The exception occurs in the main thread. This class cannot be found in the Javalang package. That is, no corresponding package is imported.

This error occurred in an example of using mina to implement communication dialogue in Java. At that time, it was because the following two packages were not imported.

Solution: Import the packages slf4j-api-1.6. and slf4j-nop-1.6.

I have the Mina package used in Android and Java in my blog resources. If you want to use it, you can download it.

Summary: Remember the problem of importing packages, especially when you are not using the packages that come with Java, you must remember them. Also, when an error occurs, copy it directly to Google and find the solution.

Error 3:

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

Reason for the error: Because the prompt is that the adb connection has been closed, a service error has occurred. That is, the adb process should be closed and eclipse should be started again.

Solution: Open the task manager and end the process directly in the process. Note that there may be multiple processes, remember to close them all.

Summary: When an error occurs that you don’t know how to deal with it, copying it to Google should solve the problem.

Attachment: Other online processing methods:Solution to the problem of The connection to adb is down in Android programming

Error 4:

:

Reason for the error: Don’t know yet? ? ? ?

Solution: Create a new project, copy the contents in it, and pay attention to the package name.

Question 5:

How to solve the problem of garbled Chinese annotations in eclipse? ?

Solution: When doing projects, you usually use UTF-8 to encode it. The default encoding of eclipse is GBK. In the menu bar, select the Preferences option, the Workspace in the first item, and after selection, there is a Text file encoding on the right. Select Default (GBK) by default. Select Other. The list is available. Select UTF-8 at the bottom. After applying it, the project you import or create will not have garbled code.

Question 6:

Setting build path has encountered a problem
Tip: "Setting build path" has encountered a problem, Could not write file D:\\workspace\aaa\.classpath

Reason for error: It is a path problem

Solution: Find the hidden .classpath file in the project and modify its hidden attributes to be visible.
This error is common in the probability that this error will occur when copying a Java project from the Eclipse working environment of one machine to the Eclipse working environment of another machine

Question 7:

: Unable to instantiate activity ComponentInfo

specific:

: Unable to instantiate activity ComponentInfo{/}: : in loader [/data/app/]

Solution: After checking the information, you will know the path problem in the imported project configuration file.

<activity
  android:label="@string/app_name"
  android:name=".MainActivity" >
  <intent-filter >
    <action android:name="" />
    <category android:name="" />
  </intent-filter>
</activity>
<activity

It should be inside

Copy the codeThe code is as follows:
android:name=".MainActivity" >

Change to:
Copy the codeThe code is as follows:
android:name="" >

I hope this article will be helpful to everyone's Android programming design.