Solve common problems in android Development

Source: Internet
Author: User

1. If the R file of your project is missing, you can try to save the version number. The R file is usually caused by layout text errors.

2. The layout file cannot contain uppercase letters.

3. the following error is thrown: Application does not specify an API level requirement !,

Because the users sdk is not specified, modify the AndroidManifest. xml file.

Add: <uses-sdkandroid: minSdkVersion = "8"> </uses-sdk>

4. machine memory bottleneck. When apk is larger than our machine memory, the simulator will throw

Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE Please check logcat output for more details. Launch canceled!

This makes debugging impossible. Now we can solve this problem in two ways.

First (only the apk is smaller than the machine memory and has been installed on the current apk, but it cannot be debugged again)

Start the simulator and enter the menu
Settings-> applications-> mange
Applications-> select the application-> select "unistall ".
In this way, the apk can be completely deleted and re-installed.

Second (General)
-Partition-size 128

In Eclipse, add Options in the project Target.

5. When the android simulator is started, the following error occurs: Failed to install on device 'emulator-100': timeout.

This is possible because of the card cause startup timeout, solution: eclipse-> window-> Preferences-> Android-> DDMS-> ADB connection time out (MS ). set the time to a longer value. The default value is 5 seconds, that is, 5000 ms. if I change it to 10 seconds, it will be OK.
In this way, you do not need to restart the simulator every time. Specific time settings are based on actual environment requirements

6. During the development process, when the apk is installed on the simulator, an error is reported.
ActivityManager: Error: Activity class {...} does not exist.
There are two solutions to this problem:
Check whether the main Activity name contains the '.' character in the AndroidManifest. xml file.

7. This error occurs when you run Eclipse.
No Launcher activity found!
The launch will only sync the application package on the device!

Solution
Add in AndroidManifest. xml
<Category android: name = "android. intent. category. LAUNCHER"/>


8 the following error occurs: java. io. FileNotFoundException:/mnt/sdcard/update.zip (Permission denied)
Solution: Write the following permissions to resource files:

<Uses-permissionandroid: name = "android. permission. WRITE_EXTERNAL_STORAGE"/>

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.