How to add google-play-services.jar project dependency so my project will run and present map

前端 未结 4 1979
自闭症患者
自闭症患者 2020-12-04 19:59

I have following problem: I try to use SupportMapFragment from com.google.android.gms.maps.SupportMapFragment which is part of Google Maps Android

相关标签:
4条回答
  • 2020-12-04 20:31

    Be Careful, Follow these steps and save your time

    1. Right Click on your Project Explorer.

    2. Select New-> Project -> Android Application Project from Existing Code

    3. Browse upto this path only - "C:\Users**your path**\Local\Android\android-sdk\extras\google\google_play_services"

    4. Be careful brose only upto - google_play_services and not upto google_play_services_lib

    5. And this way you are able to import the google play service lib.

    Let me know if you have any queries regarding the same.

    Thanks

    0 讨论(0)
  • 2020-12-04 20:35

    Some of the solutions described here did not work for me. Others did, however they produced warnings on runtime and javadoc was still not linked. After some experimenting, I managed to solve this. The steps are:

    1. Install the Google Play Services as recommended on Android Developers.

    2. Set up your project as recommended on Android Developers.

    3. If you followed 1. and 2., you should see two projects in your workspace: your project and google-play-services_lib project. Copy the docs folder which contains the javadoc from <android-sdk>/extras/google/google_play_services/ to libs folder of your project.

    4. Copy google-play-services.jar from <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/libs to 'libs' folder of your project.

    5. In google-play-services_lib project, edit libs/google-play-services.jar.properties . The <path> in doc=<path> should point to the subfolder reference of the folder docs, which you created in step 3.

    6. In Eclipse, do Project > Clean. Done, javadoc is now linked.

    0 讨论(0)
  • 2020-12-04 20:38

    What i have done is that import a new project into eclipse workspace, and that path of that was be

    android-sdk-macosx/extras/google/google_play_services/libproject/google-play-services_lib

    and add as library in your project.. that it .. simple!! you might require to add support library in your project.

    0 讨论(0)
  • 2020-12-04 20:40

    The quick start guide that keyboardsurfer references will work if you need to get your project to build properly, but it leaves you with a dummy google-play-services project in your Eclipse workspace, and it doesn't properly link Eclipse to the Google Play Services Javadocs.

    Here's what I did instead:

    1. Install the Google Play Services SDK using the instructions in the Android Maps V2 Quick Start referenced above, or the instructions to Setup Google Play Services SDK, but do not follow the instructions to add Google Play Services into your project.

    2. Right click on the project in the Package Explorer, select Properties to open the properties for your project.

    3. (Only if you already followed the instructions in the quick start guide!) Remove the dependency on the google-play-services project:

      • Click on the Android category and remove the reference to the google-play-services project.

      • Click on the Java Build Path category, then the Projects tab and remove the reference to the google-play-services project.

    4. Click on the Java Build Path category, then the Libraries tab.

    5. Click Add External JARs... and select the google-play-services.jar file. This should be in [Your ADT directory]\sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs.

    6. Click on the arrow next to the new google-play-services.jar entry, and select the Javadoc Location item.

    7. Click Edit... and select the folder containing the Google Play Services Javadocs. This should be in [Your ADT directory]\sdk\extras\google\google_play_services\docs\reference.

    8. Still in the Java Build Path category, click on the Order and Export tab. Check the box next to the google-play-services.jar entry.

    9. Click OK to save your project properties.

    Your project should now have access to the Google Play Services library, and the Javadocs should display properly in Eclipse.

    0 讨论(0)
提交回复
热议问题