-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Troubleshooting Common Issues
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.
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:
- Try restarting eclipse, quit and re-open. Check to see if autocompletion has returned.
- 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. - 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.
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
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
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
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)
Created by CodePath with much help from the community. Contributed content licensed under cc-wiki with attribution required. You are free to remix and reuse, as long as you attribute and use a similar license.
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.