3

After hours of configuring and searching through code, I have shaved off a few hundred errors and are left with these two:

"The project was not built since its build path is incomplete. Cannot find the class file for com.google.android.maps.MapActivity. Fix the build path then try building this project"

"The type com.google.android.maps.MapActivity cannot be resolved. It is indirectly referenced from required .class files"

I have looked everywhere for any hints as to how to fix this. My build path seems fine. I'm including all the JARs that might be applicable. I'm pretty sure I'm using the right ADT, so any help would be awesome regarding what needs to change.

Chris Knight
  • 24,333
  • 24
  • 88
  • 134

3 Answers3

12

You need to set your build target (e.g., Project > Properties > Android in Eclipse) to one that has the "Google APIs". Right now, my guess is that you do not.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
5

You need to set the correct Android build target in the project properties (right click your project in the Package Explorer - Properties - Android) to one having the target name "Google APIs" and the corresponding API level.

florian h
  • 1,162
  • 1
  • 10
  • 24
  • is there anything else I could do besides that? when I make that change, it causes a lot of other errors in my code. – Ian Thomas Cropper Jul 20 '12 at 22:56
  • The other errors could be ones that didn't show up before because the previous "build path error" is a very fundamental error after which the build process is cancelled, therefore not looking for other possible errors. So I guess you have to look into the new errors... – florian h Jul 21 '12 at 08:10
2

You need to make sure your project is including maps.jar in your app's build path.

To do this you have to target your application to one of the "Google APIs" (in Eclipse, Project Properties > Android). You can verify if your app will be or not compiled to that target version if your project.properties file or defaulf.properties file have a line like target=Google Inc.:Google APIs:8, i.e., you have targeted your application to Android version 2.2 (Froyo).

Also, make sure you have defined at your manifest file inside application tag the following line:

<uses-library android:name="com.google.android.maps" />

After this I recommend you to Clean your project before deploy.

yugidroid
  • 6,640
  • 2
  • 30
  • 45