Nine common errors and solutions in Android development

  • 2020-06-12 10:36:23
  • OfStack

After a variety of sorting and discussion with enthusiastic netizens, finally sorted out 9 android development of the most common problems and solutions to share again!! Useful words please top post, common progress. Well, without further ado, the following is a detailed explanation!

1. If the R file of your project is missing, you can try to change the version number and save it. The missing R file is usually caused by an error in layout text.

2. Layout files must not have capital letters

Throw the following error: Application does not specify an API level requirement! .

The AndroidManifest.xml file was modified because users sdk was not specified.

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

4. Machine memory bottleneck. When apk is larger than our machine memory, the simulator is thrown mercilessly


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

Let's get to the bottom of this problem, and there are two ways to do it

Type 1 (apk is less than machine memory only, and the current apk is installed, but debug cannot be repeated)

Start the simulator and enter the menu


settings->applications->mange
applications-> select the application->select " unistall " .

This removes the apk completely and reinstalls it

Type 2 (General)


-partition-size 128

Eclipse added to Options for project Target. # #

5. When starting the android simulator, if prompted: Failed to install on device 'ES69en-5554' : timeout

This could be a boot timeout due to a card problem, solution: eclipse - > window - > Preferences - > Android - > DDMS - > ADB connection time out(ms). Make this time longer by 1. The default is 5000ms in 5 seconds, but I changed it to ok in 10 seconds.
So you don't have to restart the simulator every time. The specific time setting is based on the actual environment

6. During the development process, apk is often reported when installed on the simulator

ActivityManager: Error: Activity class {..} does not exist.
Here are two solutions to this problem:
In the AndroidManifest.xml file, see if the name of the main Activity is preceded by the '.' character ##

7 This error occurred while running Eclipse


No Launcher activity found!
The launch will only sync the application package on the device!

The solution
Added to ES109en.xml

<category android:name= " android.intent.category.LAUNCHER " /> ##

8 the following mistakes, no sd card access rights java. io. FileNotFoundException: / mnt sdcard/update zip (Permission denied)

Solution: The resource file writes the following permissions


<uses-permissionandroid:name= " android.permission.WRITEEXTERNALSTORAGE " /> ##

9. When ES130en-ES131en failed due to different application signatures appears at runtime.

The solution
(1) cmd, enter the command line,cd to ES144en-ES145en, execute the command: adb uninstall application package name
Results after success, rerun is ok
Such as E: \ android \ android - sdk - windows \ platform - tools > adb uninstall com.wtt
Success
(2) Uninstall the phone has installed and the application of the same name can be.


Related articles: