Common eclipse usage errors and compilation errors

Source: Internet
Author: User
Tags android sdk manager

(1) Error generating final archive: Debug Certificate

This compilation error is due to the one-year trial period of the new Android SDK debugging key. If the android SDK of the computer is installed for one year, this problem may occur, to solve this problem, you only need to delete the early key file. The default key file of the system is displayed in the preferences => Android => build menu of the eclipse Window menu, Where default debug keystore is displayed.

For example, the Windows XP system currently in use may be c: \ Documents ents and Settings \ User Name \. android \ debug. keystore, you only need to delete debug. the keystore file is ready. The eclipse ADT plug-in will automatically generate a debugging version at the next compilation. The key validity period is still one year, but do not forget to delete the old version of the program on your phone, otherwise, a signature error such as re-installation failed due to different application signatures will be prompted.

(2) The select at least one project

This error occurs when a project is imported. When select all is selected, a project with the same name is prompted. The cause of this error is that the eclipse tool opened a project with the same name in the background and turned it off. The method is Windows-> show view-> Project explorer.

(3) When creating AVD: unable to find a 'userdata. IMG 'file for Abi armeabi to copy into the AVD folder

The reason is that the android SDK manager is not fully installed, that is, the arm Eabi v7a system image is rarely installed, and the installation is fine.

(4) When you click to open eclipse, a large prompt screen is displayed, with JVM exit code =-1, and a prompt for the required Java version number. The reason is strange. When I set the Java version to 1.5, I will still be prompted to request the version 1.5. When I set it to 1.6, I will load eclipse. change "xmx1024m" to "xmx512m" in the last line of INI to enable and import the android project.

(5) When using ddms of eclipse to connect to the current platform for debugging, the push content fails, prompting the read-only system to use ADB remount.

(6) When you use ddms of eclipse to connect to the current platform for debugging, the push content fails and the message out of memory is displayed. The method is as follows: Use the command first: $ emulator-AVD youravdname-partition-size 128. Then the problem maybe resolved.

(7) When debugging in ddms and copying a sequence into the file, the following error occurs: failed to pull selection or failed to push the item (s ). Try again to connect to the VM.

(8) When you import a project, the following error occurs: Project has no default. properties file! Edit the project properties to set one. How can we solve this error? There are two methods: 1. Add this default to another project. copy the properties file and use it directly. (If an error occurs in the project, re-import the project. This can be solved in general.) 2. There is a super simple method, that is, the project. rename the properties file and change it to default. the properties name is OK.
(9) When a code project is copied to the workspace and the project is imported, the following error message is displayed:

If overlap is displayed, you only need to check "Copy projects into workspace" below.

(10) When running a loaded project, the following prompt is displayed: unable to resolve target 'android-12, it indicates that the API version at the time of project creation is inconsistent with the AVD version in the current eclipse. The solution is to set default in the project. properties content # project target. change the value of target = Android-8 to a supported API version, and refresh the page. You can also see the loaded Android API package in the project browsing window.

(11) If the "Java Heap" dialog box is displayed during project compilation, You need to modify eclipse. the size of memory allocated in ini. This may also occur after some custom jar files are added. If eclipse. INI is modified, the startup of eclipse may prompt a VM startup exception. At this time, make sure that the VM path starts with the file:

-VM
C: \ Program Files \ Java \ jdk1.7.0 _ 05 \ bin \ javaw.exe

========================================================== ======= Compilation and running errors ==================================

(1) When the APK is run, an exception occurs and logcat prompts "Java. Lang. verifyerror ".
This is generally a jar error, which means it is good to reload the jar. Later, I found a problem with some classes in the front part of the error prompt. In the project, re-import these overwritten classes (without the classes in libs jar.

(2) when running the APK, the system prompts "syntax error on token (s), misplaced construct (s)", which means the constructor has Syntax problems.

(3) When editing the Java file, "the public Type xxx must be defined in its own file. ", the reason is: the public class should be the same as the file name, and the public class name in the source file should be the same as the file name. A file can only have one public class. If you just add a new class to be used in this file, you can do it without adding public. The scope of the function is the current file.

(4) If an android project requires external jar classes, in the project configuration, select "Java build path"-"librarys" Page-"add library"-"User library ", select "User libraries"-"" new "on the right of the pop-up page, and enter the desired package name (remember to check the following system library (add to the boot class path ), otherwise, a compilation error conversion to Dalvik format failed will occur. Then, you can add jars to the custom folder: on the "librarys" Page, activate the newly created package name-> "edit", and select "add" on the "preference" page.
Jars. To delete unnecessary jar files, click "edit" to edit the files. In actual use, if it is necessary to adjust the priority of the database, you also need to click the "Order and export" page to adjust the priority of the database with up or down.

(5) An error occurs in the compilation project. DEX: After the ADT and SDK tool are upgraded to the latest version (21.1 and 16.0.1 respectively), the compilation project will appear on the console:

[09:54:08-Dex loader] unable to execute DEX: cannot merge new index 68664 into a non-jumbo instruction!
[09:54:08-Com. konkagene. smartstay. smartstay] conversion to Dalvik format failed: unable to execute DEX: cannot merge new index 68664 into a non-jumbo instruction!

Many people will encounter this problem, but the numbers in the error message are different. Find the corresponding solution on the Internet: you can add a row of Dex. Force. Jumbo = true in the project. properties of the project. Clean and build again. After the experiment, the problem is confirmed to be valid and the compilation error is solved.

However, the generated APK cannot be installed on some machines (installation error: install_failed_dexopt). One possible explanation for this problem is: when the latest ADT and SDK tool convert jar to Dex, some factors may fail verification, so the installation fails.

(6) When an application is run through a VM, the following error occurs: emulator: Error: Unable to load VM from snapshot. the Snapshot has been saved for a different hardware configuration. solution: Android Virtual Device Manager-> Delete AVD-> New AVD. Create a New AVD.

(7) after the original project is normal and an external jar package is added, some package statements with no previous errors in the Java file header will prompt an error. Run clean multiple times. Some tips: a Java file contains two classes with the same name, and the class name is only distinguished by the upper and lower case mother, resulting in an error.

 

Http://www.189works.com/article-40450-1.html ()

Http://hi.baidu.com/kaisep/item/2723860c05b9777fbfe97e8c ()

Http://blog.csdn.net/soliuyong/article/details/6455734 ()

Http://blog.csdn.net/itmyhome/article/details/7010547 ()

Reference: http://bbs.csdn.net/topics/360095111? Page = 1 # post-393430875

Http://zhidao.baidu.com/question/145236382.html ()

Http://blog.csdn.net/asdf39877/article/details/8198881 ()

Http://blog.sina.com.cn/s/blog_70e6ed3a01013afx.html ()

Http://www.cnblogs.com/frydsh/archive/2013/02/20/2918969.html ()

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.