2014-10-18 81 views
22

我试图从Eclipse导入到AndroidStudio我的项目,我收到以下错误Android的工作室 - 图书馆参考../google-play-services_lib找不到进口项目

error message in android studio

首先,我不明白为什么它不替代gradle文件中相应条目的google play服务lib。

我应该怎么做才能解决这个问题?任何指导或链接到教程将有所帮助。

+0

你看过你的** project.properties **吗?在它中,它应该说'android.library.reference'指向的地方。 – 2016-07-14 16:53:00

回答

68

嗯,可能有另一种方法来解决这个问题,但我最终删除了project.properties文件中引用google-play-services_lib库的行。

+0

谢谢 - 为我工作。我也不知道如何修复,但是在删除了它的工作之后。 – Simon 2015-01-05 18:10:13

+0

酷感谢工作正常 – fullMoon 2015-01-13 13:43:20

+0

它的工作表示感谢 – Bhupinder 2015-08-15 14:15:56

3

另一种方法是简单地设置路径。无论如何,您需要通过Android SDK安装播放服务才能将其用于Android Studio。

一旦安装了播放服务,如果您在Android SDK管理器中突出显示Google play服务条目,它将向您显示安装位置的路径。在MAC上,这通常是类似于/ Users/[homedir]/android-sdks/extras/google/google_play_services/libproject

编辑project.properties中的路径以指向该文件并导入。您可以根据需要更新您的Gradle构建文件。

1

我认为“删除引用google-play-services_lib库的project.properties文件中的行不是一个很好的解决方法。 要真正修复它,请执行以下任一操作: 只需在Eclipse项目根目录的project.properties文件中编辑google-play-services_lib路径的位置即可。

android.library.reference.1 =路径/到/的/谷歌播放-services_lib

Note:If you are on windows path\comes\like\this you have to replace the backward slash with the forward slash and your path/will/become/like/this. 

例如:

C:/Users/username/AppData/Local/Android/sdk/extras/google/google_play_services/libproject/google-play-services_lib 

或替换 “\” 与 “\” 象下面:

android.library.reference.1=C:\\Users\\username\\AppData\\Local\\Android\\sdk\\extras\\google\\google_play_services\\libproject\\google-play-services_lib 

otherway是 - 只要看看错误 的最后一行的最后一部分....这样就解决了到...folder_name/google-play-services_lib

只是在那个位置创建一个文件夹,并从google_play_services\libproject\google-play-services_lib

0

最容易和简单的解决方案粘贴谷歌播放,services_lib是google-play-services_lib文件夹从其他项目或SDK文件夹,过去它的位置复制其是错误中的地址。通过在project.properties中删除或注释行会在项目中创建错误,并且除非您采取必要步骤并进行修复,否则将不允许构建。

0

最简单的解决方法是删除这行代码,android.library.reference.2 = ../谷歌播放services_lib,从项目文件(你会发现它在项目的根文件夹)休息机器人工作室将处理本身 enter image description here

找到文件: enter image description here

0

我只是改变它适用于我

android.library.reference.2 ../的Google Play-services_lib其改为

android.library.reference.google-play-services_lib