Android Studio - Library reference ../google-play-services_lib could not be found importing project

前端 未结 6 947
一个人的身影
一个人的身影 2021-02-01 17:01

I am trying to import from Eclipse to AndroidStudio a project of mine and I am getting the following error

\"error

相关标签:
6条回答
  • 2021-02-01 17:14

    Well, there might be another way of solving this problem, but I ended up removing the line in the project.properties file that was making reference to the google-play-services_lib library.

    0 讨论(0)
  • 2021-02-01 17:29

    I just changed it works for me

    android.library.reference.2../google-play-services_lib which changed to

    as

    android.library.reference.google-play-services_lib

    0 讨论(0)
  • 2021-02-01 17:30

    The simplest solutions is remove this line of code , android.library.reference.2=../google-play-services_lib,from project file (you will find it in project's root folder ) rest android studio will handle itself

    Find the file:

    0 讨论(0)
  • 2021-02-01 17:32

    An alternative is to simply set the path. You'll need to have installed play services via the Android SDK to use it with Android studio anyway.

    Once play services are installed, if you highlight the Google play services entry in the Android SDK manager it will show you the path to the install location. On MAC this is normally something like /Users/[homedir]/android-sdks/extras/google/google_play_services/libproject

    Edit the path in project.properties to point to this file and it will import. You can then update your gradle build file as necessary.

    0 讨论(0)
  • 2021-02-01 17:36

    I think "removing the line in the project.properties file that was making reference to the google-play-services_lib library" is not a good fix. To really fix it do either of these : Just edit the location of the path to google-play-services_lib in project.properties file in your Eclipse project root directory.

    android.library.reference.1=path/to/the/google-play-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.
    

    e.g :

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

    or replace "\" with "\" like below :

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

    otherway is - just look at the last portion of the last line of the error ....which resolves to ...folder_name/google-play-services_lib

    just create a folder at that location and paste google-play-services_lib from your google_play_services\libproject\google-play-services_lib

    0 讨论(0)
  • 2021-02-01 17:36

    The easiest and simple solution is to copy google-play-services_lib folder from another project or SDK folder and past it to the location which is address in the error. By removing or commenting line in the project.properties will create errors in the project and won't allow you to build unless you take necessary steps and fix.

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