Android FAQ

yuzhangqi發表於2011-10-10

You will find out troubleshooting for Android application development here.

1. ADT installation problems: cannot find org.eclipse.wst.sse.core
Q: I am running Windows 7 (64-bit) with Eclipse Indigo classic,
Java 7 SDK, and Android SDK and AVD Manager (installer_r13-windows.exe).
When I try to install the ADT in eclipse I get:
Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools
12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group
12.0.0.v201106281929-138431)
Missing requirement: Android Development Tools 12.0.0.v201106281929-138431
(com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)
requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found .
A: You need to setup the Eclipse update before installing the ADT plugin for Eclipse, follow these steps.
  1. Start Eclipse, then select Help > Install New Software....
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter "The Eclipse Project Updates" for the Name and the following URL for the Location:
  4. Click OK
  5. Click "Select All" button,then Click "Next" button to finish the eclipse update process.

2. Wrapper was not properly loaded first

Q: After I setup the Android SDK and created a new andoird project "Hello World", then to Run it, it threw an error message as below.

[2011-02-15 11:00:33 - Dex Loader] Unable to execute dex: wrapper was not properly loaded first
[2011-02-15 11:00:33 - HellWorld] Conversion to Dalvik format failed: Unable to execute dex: wrapper was not properly loaded first.

A: Locate the file "eclipse.ini" under the root directory of the Eclipse installation, for example "

C:/Program Files (x86)/eclipse

". Open it with Notepad. Change the last 2 line to be

-Xms128m
-Xmx512m

Save and close it, then restart the Eclipse IDE, click menu "Project -> Clean". It's OK now.

3. Invalid command-line parameter: Files.

Q: Create a HelloWorld android project, then run it in Emulator. It throws the following errror messages in the console.

[2011-07-13 16:22:48 - Emulator] invalid command-line parameter: Files.
[2011-07-13 16:22:48 - Emulator] Hint: use to launch a virtual device named 'foo'.
[2011-07-13 16:22:48 - Emulator] please use -help for more information

A: The reason is that you installed the android SDK on Windows 7, and the installation path is like "

C:/Program Files (x86)/Android/android-sdk
", there exists White Space in the path.

To walk this around, in Eclipse, click menu "Window -> Preferences", select "Android" on the left frame, change the SDK location to be "

C:/Program Files (x86)/Android/android-sdk

". then click "Apply" and "OK" button.

The key point here is that you should use 8.3 format names for the path. To view the 8.3 formate name for SDK location, open cmd.exe, input the following command:

dir /x c:

Alternatively, you can choose to install the android SDK under a location without White Space. That's also ok.

4. HelloAndroid stopped running on Eclipse, it did not show screen on the Emulator as expected.
Q: While running the HelloAndroid example in Eclipse, the Emulator started correctly. Howerver, there was nothing displaying on the screen. I expected to see some text like "Hello, Android".
A: In fact, everthing was fine, however, emulator was on home screen and application was running in background . To switch to application mode on emulator (so that you see the app running), you should simply press F2 (or PageUp) which is the Menu button for the emulator. (for other buttons look in: Android Emulator | Android Developers)

5. How to config Android application launch action?
Q: When there are more than one activities in an android application, Which one will be launched when the application starts?
A: This is configed in the file AndroidManifest.xml. Let's take a look at it now. It looks like below.

package="eric.android.example.helloandroid"
android:versionCode="1"
android:versionName="1.0">
6. Failed to update Eclipse from 3.7.0 to 3.7.1
Q: Open Eclipse, Select menu "Help -> Install New Software", click "Add" to open the Add Repository dialog, Input "Eclipse Update" for the Name and " " for the Location URL, then click "OK". The process of installation failed with an error message as below:

An internal error occurred during: "Install download0". Comparison method violates its general contract!

A: The error caused by Eclipse SDK update. To avoid this problem, Download the Eclipse SDK 3.7.1 from directly. Then retry the step above to install new software.

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13651903/viewspace-1055549/,如需轉載,請註明出處,否則將追究法律責任。

相關文章