By Barry Burd

When you try to run your first Android app, if your effort stalls, don’t despair. Here are some troubleshooting tips to help you resolve any problems you encounter.

The Emulator’s Screen is Too Big

Sometimes, the development computer’s screen resolution isn’t high enough. (Maybe your eyesight isn’t what it used to be.) This symptom isn’t a deal breaker, but if you can’t see the emulator’s lower buttons, you can’t easily test the app. You can change the development computer’s screen resolution; though adjusting the emulator window is less invasive.

To change the emulator window size, follow these steps:

  1. Close the emulator.

  2. From the Eclipse main menu, choose Window→Android Virtual Device Manager.

  3. In the list of virtual devices, select an AVD that’s appropriate to the project and click Start.

  4. In the resulting Launch Options dialog box, select the Scale Display to Real Size check box.

  5. Lower the value in the Screen Size field.

    As you change the Screen Size value, the value in the Scale field changes automatically. The smaller the Scale value, the smaller the emulator appears on the development computer’s screen.

  6. Click Launch.

    As a result, Eclipse launches a new copy of the emulator — this time, with a smaller emulator window.

Error message: No compatible targets were found

When you see this message, it probably means that you haven’t created an Android Virtual Device (AVD) capable of running your project. If Eclipse offers to help you create a new AVD, accept it. Otherwise, choose Window→Android Virtual Device Manager to create a new AVD.

Error message: The user data image is used by another emulator

If you see this message, a tangle involving the emulator prevents Android from doing its job. First try closing and restarting the emulator.

If a simple restart doesn’t work, try these steps:

  1. Close the emulator.

  2. From the main menu in Eclipse, choose Window→Android Virtual Device Manager.

  3. In the list of virtual devices, select an AVD that’s appropriate to the project and click Start.

  4. In the resulting Launch Options dialog box, select the Wipe User Data check box and click Launch.

    As a result, Eclipse launches a new copy of the emulator — this time, with a clean slate.

    If you follow these steps but you still see the message User data image is used by another emulator, visit the Java Programming for Android Developers for Dummies web page for more help with this problem.

Error message: Unknown virtual device name

Android looks for AVDs in the home directory’s .android/avd subdirectory, and occasionally the search goes awry. For example, say you have a Windows computer that lists your home directory on an i drive. Your AVDs are in i:Usersbarry.androidavd. Android ignores the computer’s home directory advice and instead looks in c:UsersBarry. When Android doesn’t find any AVDs, it complains.

You can devise fancy solutions to this problem by using either junctions or symbolic links. But solutions of this kind require special handling of their own. To keep it simple, you can copy the contents of your i:Usersbarry.android directory to c:Usersbarry.android to fix the problem.

Error message: INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATE

This error message indicates that an app you previously installed conflicts with the app you’re trying to install. So, on the emulator screen, navigate to the list of installed applications (which is usually an option on the Settings screen). In the list of applications, delete any apps that you installed previously.

Occasionally, you might have trouble finding previously installed apps from the Settings→Applications menus in the emulator. If you do, visit the Java Programming for Android Developers for Dummies web page for a geeky workaround solution.

The app starts, but the emulator displays the Force Close or Wait dialog box

The formal name of the Force Close or Wait dialog box is Application Not Responding (ANR). Android displays the ANR dialog box whenever an app takes too long to do whatever it’s supposed to do. When the app runs on a real device (a phone or a tablet), the app shouldn’t make Android display the ANR dialog box.

But on a slow emulator, seeing a few Force Close or Wait messages is par for the course. Just select Wait. Within about ten seconds, the dialog box usually disappears and the app continues to run.

Changes to your app don’t appear in the emulator

Your app runs and you want to make a few improvements. So, with the emulator still running, you modify the app’s code. But after choosing Run→Run As→Android Application, the app’s behavior in the emulator remains unchanged.

When this happens, something is clogged up. Close and restart the emulator. If necessary, use the Wipe User Data trick for the error message: “The user data image is used by another emulator.”