Skip to content

Troubleshooting Common Issues

Nathan Esquenazi edited this page Jan 15, 2014 · 107 revisions

If you are having trouble with Android, Eclipse, or the Emulator, check here for common problems and solutions for Android development problems. A few of the most common ones encountered are listed below.

Eclipse

Problem with Autocompletion? - You should be able to use Autocompletion (Ctrl + Space) to complete words as you code. If you can't, try the following steps:

  1. Try restarting eclipse, quit and re-open. Check to see if autocompletion has returned.
  2. Open eclipse and go to the following in the menu: Preferences > Java > Editor > Content Assist > Advanced. Select all checkboxes here (especially ones mentioning Java) and click OK.
  3. Open eclipse and go to the following in the menu: Preferences > General > Keys and the find the Command "Content Assist" in the list and remap the "Binding" to a different set of keys and click OK.

See a red line under a class that should exist (i.e ArrayList, View)? - Hover over the class and select "import" from the list of suggestions or better use "Cmd + Shift + O" to auto-import all missing types.

Red Line

Emulator

App running in emulator but no logs showing up in LogCat?

  • Switch to DDMS mode in Eclipse
  • Verify the emulator is listed and select the emulator
  • Select the small down arrow and click "reset adb"
  • Still having problems? Time to restart eclipse

Reset ADB

Booting the emulator is slow?

  • Open "Window => Android Virtual Device Manager"
  • Click "Edit" on your Virtual Device and verify "Intel x86" is selected for CPU
  • Make sure not to close your emulator once it is booted, leave it open and just re-run

Intel HAXM

Started emulator either doesn't boot, freezes computer or looks glitchy

  • Go to Intel HAXM page and install the latest hotfixes for your platform.
  • Open "Window => Android Virtual Device Manager"
  • Click "Edit" on your Virtual Device and toggle the "Use Host GPU" checkbox
  • Verify the CPU has "Intel x86" selected rather than "ARM"
  • Now fully restart the emulator and relaunch

Host GPU

Android

I am getting an error "Application has stopped" in a dialog and my app closes

  • This means your application had a runtime crash
  • If you don't see LogCat, open with Window => Show View => Other => Android => LogCat
  • Use LogCat to debug where the crash originated (or use the debugger)
  • Find the error stacktrace and identify the line (in your code) that triggered the error.
  • This is often a NullPointerException (accessing a null object) or other null references (such as an android:onClick handler referencing a non-existent method)

Show LogCat LogCat

Finding these guides helpful?

We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.

Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.

Clone this wiki locally