eclipse won't find imports

1.4k views Asked by At

I am trying to follow the instructions at the following site to install a picasa web android client application:

http://samples.google-api-java-client.googlecode.com/hg/picasa-android-sample/instructions.html?r=default

I don't have a clue why this project needs mercurial (a source control tool) and maven (a build tool) when none of the other projects I've worked with needed either, but nevertheless I've followed all the steps and I've almost got the code running but, I've stumbled upon the following problem:

the first set of imports such as

import com.google.api.client.extensions.android2.AndroidHttp;

works fine whereas the second set such as

import android.accounts.Account;

flags as an error (the import cannot be resolved).

and I get the following error message in the developer console:

[2012-01-19 00:10:06 - picasa-android-sample] Unable to resolve target 'Google Inc.:Google APIs:7'
[2012-01-19 00:10:06 - picasa-android-sample] Unable to resolve target 'Google Inc.:Google APIs:7'
[2012-01-19 00:10:06 - picasa-android-sample] Unable to resolve target 'Google Inc.:Google APIs:7'

In eclipse navigator I have a folder-like widget called src/main/java which looks odd (not sure why it is not three folders).

But my main and most important question is, why are the imports not being found?

1

There are 1 answers

0
FoamyGuy On

In eclispse right click your project and open properties. Chose android and see what version of Android you are targeting. You might need to select one that that includes Google API's. Those are separated out from the core of the OS and offer access to some of the google services.

Here is where you can find more info about the Google APIs sdk addon if you don't already have it installed and being recognized by your eclipse.