Home WeChat Applet Mini Program Development Summary of 12 errors in developing Android applets with Eclipse

Summary of 12 errors in developing Android applets with Eclipse

May 03, 2017 am 11:48 AM

I encountered some small problems when developing Android small programs with Eclipse. In the process of learning, I will record the problems encountered. It is quite complicated, including program errors, Linux applications, eclipse settings, etc. ~

1. ERROR: Application requires API version 10. Device API version is 8 Solution: Modify two configuration files 1: In AndroidManifest.xml, Find this line. This line indicates the minimum version required to run this application. Change the number to the version on the simulator. (Device API) 2: In default.properties, target=android-8, change the target to the version to run the emulator and it will be OK. (application requires API)

2. Android requires compiler compliance level 5.0. Please fix project properties. Error Solution: 1. Right-click the project->android tools ->Fix Project 2. If not, check Project -> Properties->Java Compiler to confirm that JDK compliance is set to 1.6, and enable specific seeings.

3. Download In the .java file, the comments are basically in Chinese. In Linux, the Chinese part is garbled. The encoding of Chinese under Windows is generally gbk, while the encoding of Chinese under Linux is generally utf8, so it can be opened normally under Windows. The files are likely to be garbled under Linux. Solution: Use the iconv command to convert the file content encoding. For example, I have a file "Common Linux Commands" that opens normally under Windows, but will be garbled when opened under Linux. The method is to enter in the terminal: iconv -f gbk -t utf8 Common Linux Commands.txt > Common Linux Commands_cn .txt and then open the file "Linux Common Commands_cn.txt", the garbled problem of the file will be solved.

4. Exlipse three methods to display line number Solution: 1.Ctrl+f10 to display the menu and check the show line number option; 2. In the code editing area Right-click on the far left (that is, where the line number should be displayed), and the shortcut menu that appears is as shown in Solution 1; 3. Click Window (or right-click in the code editing area) ->Preferences->Gerenal->Editors-> ;Text Editors, then check the show line number check box

5. Install eclipse under windows and set the java jdk environment variable

1. The eclipse download address is www.eclipse. org/downloads/, find the download that matches the system you are using, and then unzip it

java jdk download address www.oracle.com/technetwork/java/javase/downloads/index.html

2. Configuration of java jdk environment variables: To put it simply, you need to set path and classpath. Bin must be added to path, and lib must be added to classpath.

My Computer->Properties->Advanced System Configuration.

1) It is already available in the path system. Just add the bin address in it and separate each path with;.

For example: C:\Program Files\Java\jdk1.6.0\bin

2) You need to create a new classpath yourself. Of course, if it already exists, you can just edit it in it. Pay attention to the classpath in front of it. There is .; represents the current path.

For example: .;C:\Program Files\Java\jdk1.6.0\lib\dt.jar;C:\Program Files\Java\jdk1.6.0\lib\tools.jar

3) In order to facilitate writing and future changes, you can set the java_home variable to C:\Program Files\Java\jdk1.6.0, so that %java_home% can be used to replace C:\Program Files in path and classpath. \Java\jdk1.6.0

For example: path can be set to %java_home%\bin

6. Configure the environment and run eclipse and Failed to load the JNI shared appears. library jvm.dll error

Solution: The windows used is 64-bit, and the 64-bit eclipse is downloaded, but the java sdk downloaded is 32-bit, which is a mistake. . . Change to 64-bit~

7. ANT environment variable settings

There are two main environment variables used by ANT under Windows, ANT_HOME, PATH.

Set ANT_HOME to point to the ant installation directory.

Setting method: ANT_HOME = D:\apache_ant_1.7.0

Add %ANT_HOME%\bin; %ANT_HOME%\lib to the path of the environment variable.

Setting method: PATH = %ANT_HOME%\bin; %ANT_HOME%\lib

8. Expected to find it in D:\jre6\lib\tools. jar

After typing the ant command on the command line, it prompts: "Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar"; the ANT_HOME environment variable has been configured; Solution: Copy the tools.jar file in the "C:\Program Files\Java\jdk1.6.0_16\lib" directory to the "C:\Program Files\Java\jre6\lib" directory, and rerun the command ant. It runs normally. problem solved.

9. Test run failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'

JUnit is not introduced, check whether it is in the configuration JUnit is checked. Project -> Properties -> Java Build Path -> Order and Export and check JUnit if it is unchecked.

10. Test run failed: Instrumentation run failed due to 'java.lang.ClassCastException'

Delete the package and develop the project package and Delete all test packages and reinstall them! ! !

11. After installing ADT and Android SDK, there are no two icons of Android SDK Manager and Android virtual Device Manager

##Eclipse - >window->customize Perpective->Command Groups Availability Check the andorid option

12. error: Error: No resource found that matches the given name (at ' background' with value '@drawable/btn_title_back_big').

The error shows that basically all resource files have errors. Right-click on the console, select preferences, and set the console buffer size to be large enough. By adding a 0, you can see which resource file is wrong and correct it.

The above is the detailed content of Summary of 12 errors in developing Android applets with Eclipse. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades Sep 12, 2024 pm 12:23 PM

In recent days, Ice Universe has been steadily revealing details about the Galaxy S25 Ultra, which is widely believed to be Samsung's next flagship smartphone. Among other things, the leaker claimed that Samsung only plans to bring one camera upgrade

Samsung Galaxy S25 Ultra leaks in first render images with rumoured design changes revealed Samsung Galaxy S25 Ultra leaks in first render images with rumoured design changes revealed Sep 11, 2024 am 06:37 AM

OnLeaks has now partnered with Android Headlines to provide a first look at the Galaxy S25 Ultra, a few days after a failed attempt to generate upwards of $4,000 from his X (formerly Twitter) followers. For context, the render images embedded below h

IFA 2024 | TCL\'s NXTPAPER 14 won\'t match the Galaxy Tab S10 Ultra in performance, but it nearly matches it in size IFA 2024 | TCL\'s NXTPAPER 14 won\'t match the Galaxy Tab S10 Ultra in performance, but it nearly matches it in size Sep 07, 2024 am 06:35 AM

Alongside announcing two new smartphones, TCL has also announced a new Android tablet called the NXTPAPER 14, and its massive screen size is one of its selling points. The NXTPAPER 14 features version 3.0 of TCL's signature brand of matte LCD panels

Vivo Y300 Pro packs 6,500 mAh battery in a slim 7.69 mm body Vivo Y300 Pro packs 6,500 mAh battery in a slim 7.69 mm body Sep 07, 2024 am 06:39 AM

The Vivo Y300 Pro just got fully revealed, and it's one of the slimmest mid-range Android phones with a large battery. To be exact, the smartphone is only 7.69 mm thick but features a 6,500 mAh battery. This is the same capacity as the recently launc

Samsung Galaxy S24 FE billed to launch for less than expected in four colours and two memory options Samsung Galaxy S24 FE billed to launch for less than expected in four colours and two memory options Sep 12, 2024 pm 09:21 PM

Samsung has not offered any hints yet about when it will update its Fan Edition (FE) smartphone series. As it stands, the Galaxy S23 FE remains the company's most recent edition, having been presented at the start of October 2023. However, plenty of

New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades New report delivers damning assessment of rumoured Samsung Galaxy S25, Galaxy S25 Plus and Galaxy S25 Ultra camera upgrades Sep 12, 2024 pm 12:22 PM

In recent days, Ice Universe has been steadily revealing details about the Galaxy S25 Ultra, which is widely believed to be Samsung's next flagship smartphone. Among other things, the leaker claimed that Samsung only plans to bring one camera upgrade

Xiaomi Redmi Note 14 Pro Plus arrives as first Qualcomm Snapdragon 7s Gen 3 smartphone with Light Hunter 800 camera Xiaomi Redmi Note 14 Pro Plus arrives as first Qualcomm Snapdragon 7s Gen 3 smartphone with Light Hunter 800 camera Sep 27, 2024 am 06:23 AM

The Redmi Note 14 Pro Plus is now official as a direct successor to last year'sRedmi Note 13 Pro Plus(curr. $375 on Amazon). As expected, the Redmi Note 14 Pro Plus heads up the Redmi Note 14 series alongside theRedmi Note 14and Redmi Note 14 Pro. Li

Motorola Razr 50s shows itself as possible new budget foldable in early leak Motorola Razr 50s shows itself as possible new budget foldable in early leak Sep 07, 2024 am 09:35 AM

Motorola has released countless devices this year, although only two of them are foldables. For context, while most of the world has received the pair as the Razr 50 and Razr 50 Ultra, Motorola offers them in North America as the Razr 2024 and Razr 2

See all articles