-1

I'm trying to use Google Map V2, I had follow instructions from : https://developer.android.com/google/play-services/maps.html

I had done: Sign up to Google Map API and get my API Key. Update my SDK for import play-service. Import into my folder. Import the library in my workspace to my project. Here below my project with imported libraries.

https://i.stack.imgur.com/NIKsi.png

In the manifest, if I remove the line: com.google.android.gms It's works, I can launch, compile and use my app.

I use a real phone, sony 4.2.

Do you have any idea for why my build fail ? I don't understand :/ Thank.

j0k
  • 22,600
  • 28
  • 79
  • 90
Vadorequest
  • 16,593
  • 24
  • 118
  • 215
  • I have follow tuto from : https://developers.google.com/maps/documentation/android/start#specify_settings_in_the_application_manifest http://stackoverflow.com/questions/13719263/unable-instantiate-android-gms-maps-mapfragment too, but .... – Vadorequest May 20 '13 at 21:22
  • Go to project properties -> Java Build Path -> order and export and select play services lib. – Raymond P May 20 '13 at 21:26
  • @RaymondP It's already done. But... In fact I can't add directly play-service-lib*.jar only his parent group like Google APIs [Android 4.2.2], Android Private Libraries and Android Dependencies. I have not the .jar into the list when I have ormlite.jar, guice.jar, javax.inject.jar – Vadorequest May 20 '13 at 21:33

1 Answers1

1

Get rid of both <uses-library> elements.

The one for com.google.android.maps is for Maps V1, and you are not using Maps V1.

The second one is something that you completely made up yourself. There is no such library, and therefore your <uses-library> statement will fail on 100% of Android devices.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • If I had add this lines to the manifest it's because I had read to do it. I search now where. – Vadorequest May 20 '13 at 21:33
  • "If I had add this lines to the manifest it's because I had read to do it" -- I will be stunned if you read to add your second `` element in any official documentation. Please simply remove both `` elements. – CommonsWare May 20 '13 at 21:44
  • Okay, I have found why I had add the line into the manifest->application. It's because the API RoboGuice use it, with RoboMapActivity class who extends to com.google.android.mapsMapActivity. Then if I don't add this to the manifest, I get one error. (Could not find class..) – Vadorequest May 20 '13 at 21:49
  • I'm trying to not use RoboGuice, so extends my class from MapActivity, but it's the same problem, I can extends only from com.google.android.maps.MapActivity; and you said it's 1.0 deprecated ? I have an error somewhere... – Vadorequest May 20 '13 at 21:51
  • @Vadorequest: Everything you have described in the previous two comments is for Maps V1. You need to decide if you are using Maps V1 or Maps V2. If you are using Maps V2, you would not use `com.google.android.maps.MapActivity`, as that is for Maps V1. – CommonsWare May 20 '13 at 21:52
  • I want use Maps V2, but my application recognize only map v1, I can't use com.google.android.gms.maps.MapActivity. – Vadorequest May 20 '13 at 22:01
  • @Vadorequest: That is because there is no such class as `com.google.android.gms.maps.MapActivity`. – CommonsWare May 20 '13 at 22:03
  • Okay... I'm trying to use the samples proposed, but they don't works too. I have added the jars: android-support-v4 and google-play-services in Referenced Libraries but I have again some errors into the XML files => layout/camera_dao.xml at this instruction: With the error "Not identifier found for this..." Why is wrong ? Thank for your help. – Vadorequest May 20 '13 at 22:12
  • I have found why. In fact several bug mixed, the last one was I use MapFragment in my XML and it's cannot be cast to FragmentActivity like writed in the sample. https://developers.google.com/maps/documentation/android/start#specify_settings_in_the_application_manifest This tuto help me at the end, very useful ! https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw – Vadorequest May 20 '13 at 22:36
  • Thank you really for your help, without I'd fallen asleep unhappy. ^_^ – Vadorequest May 20 '13 at 22:38