Importing google-play-service library showing a re

2019-01-01 07:25发布

Am trying to add google-play-service library in my project using import(For Google map). After adding the path am getting red X next to this reference and the reference is not adding . Know how to resolve this ?

9条回答
爱死公子算了
2楼-- · 2019-01-01 07:47

Try to place the Google-play-service library with in your same working Directory by coping the files from Click File > Import, select Android > Existing Android Code into Work space, and browse the work space import the library project.

查看更多
零度萤火
3楼-- · 2019-01-01 07:47

This is common issue Youur google-play-service-lib project and your android project should be inside the same folder For example if your Android Appplication name is MyMap is in D:/workspace t hen your play service lib project should be in the same directory D:/workspace

查看更多
素衣白纱
4楼-- · 2019-01-01 07:49

Eclipse does weird things when importing an existing project (google-play-services-lib), especially if you try to import and then allow the project to be automatically 'copied' to your workspace. I had the same issue and here is how I fixed it:

  • Close Eclipse

  • Erase all google-play-services projects from your workspace

  • Manually copy the google-play-services-lib folder (....sdk\extras\google\google_play_services\libproject\google-play-services_lib) into your workspace

  • Open Eclipse

  • Add a new project, choosing 'Existing Android Project', then navigate to your workspace and add the newly copied google-play-services-lib project

  • Finally, add the google-play-services-lib to your project as a library (just like you normally would)

Hope this helps! :)

查看更多
明月照影归
5楼-- · 2019-01-01 07:54

You add Project in to your workspace. Start Eclipse and import project one option is ther copy to workspace do it. After that add google play services it also copy in to your work space and add it your library hope so its working.

查看更多
查无此人
6楼-- · 2019-01-01 07:58

The red X means its a broken link path.

http://developer.android.com/google/play-services/setup.html

Copy the google-play services_lib library project to your workspace (folder where your android map project is). The library project can be found under the following path.

     <android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib library project .

Import the library project to your eclipse

Click File > Import, select Android > Existing Android Code into Workspace, and browse the workspace import the library project. You can check if it is library project. Right click on the library project. Goto properties. Click Android on the left panel. You will see Is Library checked.

Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply

enter image description here

查看更多
皆成旧梦
7楼-- · 2019-01-01 08:01

I was also getting same problem.

I copied google library folder into work space and import now it's working fine.

查看更多
登录 后发表回答