Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

error message in android studio

First I do not understand why it does not replace the google play services lib for the corresponding entry in the gradle file.

What should I do in order to fix the situation? Any guidance or link to a tutorial would be helpful.

like image 281
AlvaroSantisteban Avatar asked Oct 18 '14 19:10

AlvaroSantisteban


Video Answer


5 Answers

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.

like image 161
AlvaroSantisteban Avatar answered Oct 23 '22 00:10

AlvaroSantisteban


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 enter image description here

Find the file: enter image description here

like image 22
Adeeb karim Avatar answered Oct 22 '22 23:10

Adeeb karim


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.

like image 3
mark Avatar answered Oct 22 '22 23:10

mark


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

like image 1
Raulp Avatar answered Oct 23 '22 01:10

Raulp


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

like image 1
Prathap Reddy Avatar answered Oct 23 '22 00:10

Prathap Reddy