ElectronAnt
ElectronAnt

Reputation: 2195

Eclipse not Recognizing any imports

I seem to have botched up something in Eclipse. It isn't recognizing any of the libraries that I am trying to import.

Here are some of the things not being recognized:

import java.util.ArrayList;
import android.content.Intent;
import com.google.android.maps.MapView;

This is a open source project that I downloaded and then imported into Eclipse. I think I also downloaded the google apis the wrong way because things like MapView don't work in my other projects as well. Can someone please help me out?

Best,

Aneem

EDIT:

Fixed, most of the issues. Did it by hovering mouse to import line and clicking "Fix project setup..."

Now the only thing I have to do is get the google map related API to work.

Upvotes: 6

Views: 10907

Answers (4)

Mahdi Naderian
Mahdi Naderian

Reputation: 101

Two things to consider:

  1. Open project properties -> Android section, see if Android SDK is selected or not. if no SDK is selected just check it.

  2. In project properties -> Java Compiler section, change "Compiler compliance level" to "1.6". This is because you have installed JDK 1.7 that has some problems with some packages!

Upvotes: 1

johngoche9999
johngoche9999

Reputation: 1711

I right clicked on the project and selected properties and added Google APIs 2.3.3 as the target and did a project->clean and was able to launch the application. Many thanks.

Upvotes: 0

dcanh121
dcanh121

Reputation: 4695

To check if you have properly installed ADT goto -> Window -> Preferences. If you see Android (in the preferences), it means you have ADT installed.

To point to the valid SDK directory, click on Android. Specify the location in the SDK location.

Even if you have correctly installed ADT and SDK, there is a chance that eclipse may not recognize as the Android project if you import it(depends on the project & files). Best thing is, to create a new Android project and copy the files from the imported project to the newly created Android project. This will definitely work.

Upvotes: 5

SeanPONeil
SeanPONeil

Reputation: 3910

Most likely your ADT plugin is not pointing to the Android SDK. Follow the instructions for installing and configuring the plugin:

http://developer.android.com/sdk/eclipse-adt.html

Upvotes: 0

Related Questions