Copyright © 2009-2015 vogella GmbH
Table of Contents
Things are not always working as they should during your Android development. This section gives an overview over typical problems and how to solve them.
Several users report that they get the following errors:
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.
To solve any of these errors, go to the project menu and select→ .
If you have library projects, make sure to clean them too.
During start or during execution of your application, your application stops. In the LogCat view you see the message: android.content.ActivityNotFoundException : Unable to find explicit activity class; have you declared this activity in your AndroidManifest.xml?
Check in this case if you declared your
The communication with the emulator or your Android device might have problems. This communication is handled by the Android Debug Bridge (adb).
Eclipse allows you 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
If this does not work, locate the
and type the commands
followed by an
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 → → → → .
If Android complains that you cannot use Java7 select your right-click on your project and select the Java Compiler entry. Ensure that Java 1.5 or Java 1.6 is used. You may have to select the Enable project specific settings checkbox.
This sections lists problem which happen sometimes but are not that frequently as the problems from the previous section.
Caused by an attempt to load the same fragment twice. The second time it is added to the FragmentManager this exception is thrown.
Solution: ensure that each fragment is only added once to an activity.
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 ADB connection timeout (in ms) value.→ → → and increase the
Sometimes the emulator will refuse to install an application with the error message: INSTALL_FAILED_INSUFFICIENT_STORAGE.
An Android virtual device provides by default only 64M for the storaging Android applications. You can clean your installed application by restarting the emulator and selecting the Wipe user data flag.
Alternatively you can set the data partition size. If you
you can set the
Ideal size of data partition
property via the
If you get the error message
Debug Certificate expired
to the folder which contains the Android AVD, e.g.
Linux and delete the
file. This file is only
for a year and if not present, Eclipse
will regenerate the
annotation was introduced in Java 1.6. If you receive
@Override, change the Java compiler level to Java 1.6. To do this,
in the drop-down box.
|TRAINING||SERVICE & SUPPORT|
|The vogella company provides comprehensive training and education services from experts in the areas of Eclipse RCP, Android, Git, Java, Gradle and Spring. We offer both public and inhouse training. Whichever course you decide to take, you are guaranteed to experience what many before you refer to as “The best IT class I have ever attended”.||The vogella company offers expert consulting services, development support and coaching. Our customers range from Fortune 100 corporations to individual developers.|