sayres kabir
sayres kabir

Reputation: 362

Failed to add play-services to android studio

I want to do a practice project that i can find my location by google map. at first i installed google play service lib : enter image description here

second, I add FINE permission and mate tag on manifest :

<?xml version="1.0" encoding="utf-8"?>

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>

    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

third, I have added this lib on build.gradle:

compile 'com.google.android.gms:play-services:11.0.1'

but when i am syncing project< i got this error:

Error:(29, 13) Failed to resolve: com.google.android.gms:play-services:11.0.1

and Avoid using bundled version of Google Play services SDK.

what can i do? what any dependency i need?

Upvotes: 0

Views: 567

Answers (1)

Harmantj
Harmantj

Reputation: 182

Implement separate lib of google play services, that is more efficient than using the whole package. Use only required lib.

https://developers.google.com/android/guides/setup

Upvotes: 1

Related Questions