1

I can't build my android project, it says that com.google.android.maps does not exist. It is way strange because in my project in libraries I have them. I rebuild the build.xml. The import com.google.android.maps.MapActivity; is not marked as error. What should I do?

Handling Resources...
Generating resource IDs...
C:\android-sdk-windows\tools\ant\build.xml:600: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Compiling 13 source files to C:\Users\iie\Documents\NetBeansProjects\AndroidApplication3\bin\classes
C:\Users\bla\Documents\NetBeansProjects\AndroidApplication3\src\menu\dot\MapMapa.java:10: error: package com.google.android.maps does not exist
import com.google.android.maps.MapActivity;
C:\Users\bla\Documents\NetBeansProjects\AndroidApplication3\src\menu\dot\MapMapa.java:16: error: cannot find symbol
public class MapMapa extends MapActivity {
  symbol: class MapActivity
C:\Users\bla\Documents\NetBeansProjects\AndroidApplication3\src\menu\dot\MapMapa.java:21: error: cannot find symbol
        super.onCreate(icicle);
  symbol:   variable super
  location: class MapMapa
C:\Users\bla\Documents\NetBeansProjects\AndroidApplication3\src\menu\dot\MapMapa.java:23: error: cannot find symbol
         setContentView(R.layout.map);      
  symbol:   method setContentView(int)
  location: class MapMapa
C:\Users\bla\Documents\NetBeansProjects\AndroidApplication3\src\menu\dot\MapMapa.java:19: error: method does not override or implement a method from a supertype
    @Override
C:\Users\bla\Documents\NetBeansProjects\AndroidApplication3\src\menu\dot\MapMapa.java:26: error: method does not override or implement a method from a supertype
    @Override
6 errors
C:\android-sdk-windows\tools\ant\build.xml:580: The following error occurred while executing this line:
C:\android-sdk-windows\tools\ant\build.xml:600: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
iie
  • 501
  • 4
  • 8
  • 26

2 Answers2

4

Make sure you

  • install the Google APIs in your Android SDK (this means the "Google APIs" choice instead of the "Android X.x" one)

  • specify to use this library in your manifest XML:

    <uses-library android:name="com.google.android.maps" />
    
  • choose "Google API" as your "Build Target", not the "Android X.x" one.

FYI, when testing with the emulator AVD, you need to launch the "Google APIs" version instead of the "Android X.x" one.

Dan J
  • 25,433
  • 17
  • 100
  • 173
  • u see it is strange, because I have the library maps.jar in my libraries, but the error is still the same. I've done all these things u mentioned – iie Nov 01 '11 at 19:50
  • Try doing a completely clean build. In Eclipse you shouldn't need to manually put the maps.jar into your project - it should be picked up automatically from using the "Google APIs" instead of "Android X.x". – Dan J Nov 01 '11 at 21:19
  • I can't make any build, I've tried clean & build but always stack with this error – iie Nov 01 '11 at 22:12
  • if you are using Gradle, change compileSdkVersion=x to compileSdkVersion "Google Inc.:Google APIs:x" where is your SDK version – Aleksey Khivrenko Mar 11 '16 at 22:09
2

ok, finally I managed to sort it out:

here is a link with everything:

http://code.davidjanes.com/blog/2009/11/13/18-hours-of-jar-hell-with-android-google-maps/

sorry for answering my own question

iie
  • 501
  • 4
  • 8
  • 26