Things are not always working as they should. This section gives an overview over typical problems and how to solve them.
Never use a workspace in Eclipse which has spaces in the directory path name, this may lead to several strange problems.
Several users report that they get the following errors:
To solve any of these errors, go to the project menu and select → .
- Project ... is missing required source folder: 'gen'
- The project could not be built until build path errors are resolved.
- Unable to open class file R.java.
The
communication with the emulator or your Android device might have
problems. This communication is handled by the Android Debug Bridge
(adb).
Eclipse allows to reset the adb in case this causes problems. Select therefore the DDMS perspective via → → →
To restart the adb, select the "Reset adb" in the Device
Eclipse allows to reset the adb in case this causes problems. Select therefore the DDMS perspective via → → →
To restart the adb, select the "Reset adb" in the Device
View
.
The "LogCat"
View
shows you the log messages of your Android device and helps you to
analyze problems. For example Java exceptions in your program would be
shown here. To open this view, select → → → → .
Android
provides nice editors to edit Android resource files, unfortunately
these editor are not always automatically used due to bugs in the ADT.
If that happens, you can open this editor manually. Right-click on your
menu file and select → .
If your emulator does not start, make sure that the android-sdk version is in a path without any spaces in the path name.
If you face timeout issues during deployment you can increase the default timeout in the Eclipse preferences. Select → → → and increase the "ADB connection timeout (in ms)" value.
Sometimes the emulator will refuse to install an application with the error message: INSTALL_FAILED_INSUFFICIENT_STORAGE.
An Android virtual device provides per default only 64M for the storaging Android applications. You can clean your installed application by re-starting the emulator and selecting the "Wipe user data" flag.
Alternatively you can set the data partition size. If you press edit on the AVD, you can set the "Ideal size of data partition" property via the "New" button.
An Android virtual device provides per default only 64M for the storaging Android applications. You can clean your installed application by re-starting the emulator and selecting the "Wipe user data" flag.
Alternatively you can set the data partition size. If you press edit on the AVD, you can set the "Ideal size of data partition" property via the "New" button.
If
you get the error message "Debug Certificate expired" switch to the
folder which contains the Android AVD, e.g. ".android" under Linux and
delete the "debug.keystore" file. This file is only valid for a year and
if not present, Eclipse will regenerate the password.
The @override annotation was introduced in Java 1.6. If you receive an error message for
@override
, change the Java compiler level to Java 1.6. To do this, right-click on the project, select → → and select "1.6" in the drop-down box.
Java requires that classes which are not part of the standard Java Language are either fully qualified or declared via imports.
If you see an error message with "XX cannot be resolved to a variable", right-click in your
If you see an error message with "XX cannot be resolved to a variable", right-click in your
Editor
and select → to important required packages.
No comments:
Post a Comment