FAQ about Android Development Environment

Source: Internet
Author: User

To do well, you must first sharpen your tools.

Compared with iOS development, Android development environments have many versions, resulting in many problems. Obviously, we should not waste valuable time solving the problems brought about by the development environment. Therefore, this article summarizes the common development environment problems and solutions for you to query and supplement them at any time.

Debug certificate expired

The certificate file debug. keystore generated by the Android SDK for debugging is valid for 365 days. This error is reported on the console after more than one year.

Error generating final archive: Debug Certificate expired on 10/09/18 16:30

The solution is to manually delete the debug. keystore file, which is located in the "C: \ Documents and Settings \ username \. android" directory in Windows, and in Linux and Mac systems "~ /. Android/"directory. Eclipse automatically creates a debug. keystore file when you start the application next time. It is best to "Project-> Clean" the Project to trigger the compiler to recompile.

Failed to install apk on device: timeout

The exact cause of this problem is unclear, probably because the adb connection is closed incorrectly.

Failed to install helloworld.apk on device 'emulator-5554': timeout

Solution 1: Replace the USB port of the Computer (without the USB port) or reinstall the mobile phone driver. Shut down the mobile phone and then start the system.

Solution 2: Select "window-> preferences-> Android-> ddms-> ADB connection time out" in eclipse to change the default 20000 Ms value to a larger value, for example, Ms.

Solution 3: Enter the following commands in the command line window:

adb kill-serveradb start-server
Invalid command-line parameter

This is because the eclipse development environment cannot find the desired executable file.

 
[2011-07-10 07:10:22 - demo] Android Launch![2011-07-10 07:10:24 - demo] adb is running normally.[2011-07-10 07:10:24 - demo] Performing com.demo.DemoActivity activity launch[2011-07-10 07:10:25 - demo] Automatic Target Mode: launching new emulator with compatible AVD 'xxx'[2011-07-10 07:10:25 - demo] Launching a new emulator with Virtual Device 'xxx'[2011-07-10 07:11:06 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
 

The solution is to select the "window-> preferences-> android" option in eclipse and check whether the "SDK location" path contains spaces. If it is "C: \ Program Files \ android "is changed to" C: \ progra ~ 1 \ android ", so that the command line can be called normally.

Tip: Enter the "DIR/X" command in the command line window to list the file names in the 8.3 format. See the following results:

2012-09-25  23:52    <DIR>          WATCHD~1     WatchData2012-09-01  11:01    <DIR>                       Winamp2012-07-24  22:22    <DIR>          WINDOW~4     Windows Live2012-07-24  22:21    <DIR>          WI3957~1     Windows Live SkyDrive
INSTALL_FAILED_INSUFFICIENT_STORAGE

This error is reported when the storage capacity is insufficient during application installation:

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

If you are running an application on the simulator, you can increase the AVD memory capacity.

If you are running on a real machine, you can modify the installation preference in androidmanifest. xml so that the application can be directly installed on the SD card.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.example"    android:installLocation="preferExternal" >...</manifest>
Unable to open sync connection

Although many people encounter this problem, the root cause of the problem is not exact. This error may be reported by ADB due to multiple reasons:

 
[2010-10-12 09:36:48 - myapp] Android Launch![2010-10-12 09:36:48 - myapp] adb is running normally.[2010-10-12 09:36:48 - myapp] Performing com.mycompany.myapp.MyActivity activity launch[2010-10-12 09:36:48 - myapp] Automatic Target Mode: using device 'xxx'[2010-10-12 09:36:48 - myapp] Uploading myapp.apk onto device 'xxx'[2010-10-12 09:36:48 - myapp] Failed to upload myapp.apk on device 'xxx'[2010-10-12 09:36:48 - myapp] java.io.IOException: Unable to open sync connection![2010-10-12 09:36:48 - myapp] Launch canceled!
 

Solution 1: unplug the phone connection and connect it again;

Solution 2: Disable the debug option on the mobile phone and enable it again. This option is displayed in Settings> Application> development> USB debugging on the mobile phone.

Too program open files

This problem is related to the number of files that can be opened by the system at the same time, but generally you do not need to modify the relevant settings. You can solve this problem by using the unable to open sync connection method.

Third-party Jar package, NoClassDefFoundError

This problem may occur after the ADT version is upgraded: All normal Android projects have been upgraded. After the upgrade, all classes in the third-party jar package will prompt noclassdeffounderror.

The cause may be the difference in the ant script compilation used by ADT of different versions. There are two possible solutions:

Method 1: Right-click your android project in eclipse and choose "properties-> JAVA build path-> order and export ", check boxes before all third-party jar packages are checked here.

Method 2: Check whether your third-party jar package file is in the "Libs" directory under the project directory. If not, change it.

References

"Debug Certificate Expired" error in eclipse android
Plugins

Android error: failed to install *. APK on device *: timeout

The android emulator is not starting,
Showing "invalid command-line parameter"

Solution: Android install_failed_insufficient_storage
Error

Android ADB "unable to open sync connection !"

Com. Android. ddmlib. syncexception: Too program open files

Noclassdeffounderror-Eclipse and Android

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.