Karthikeyan P
Karthikeyan P

Reputation: 475

Missing Google APIs for API Level 25

In the Android SDK Manager, I am unable to find the Google API for API Level 25. Because of this I am unable to set the compileSdkVersion to 'Google Inc.:Google APIs:25'. I am using MapActivity in my application and due to incompatible sdk version com.google.android is not supported.Is there any other way to make this work without Google API ?

Upvotes: 19

Views: 2971

Answers (7)

Vineet Jain
Vineet Jain

Reputation: 1575

You can make maps in Eclipse then sync maps files with rest of application files in Android Studio or you can directly change your application files in Android Studio according to steps given in following link.
For Eclipse follow these steps

Upvotes: 2

Fedor
Fedor

Reputation: 43412

MapActivity is part of Google Maps API v1. And Google Maps API v1 is deprecated long time ago https://developers.google.com/maps/documentation/android-api/v1. It still worked till now but seems to be missing since SDK 25.

So we have to transition to Google Maps API v2 https://developers.google.com/maps/documentation/android-api/start. It's distributed as a part of Google Play Services library so you don't have to build with Google API to use it. You just need to add gradle dependensites as mentioned in previous answers. You also need to stop using deprecated MapActivity and start using new MapFragment.

Upvotes: 0

karthik Dhanajeyan
karthik Dhanajeyan

Reputation: 67

Try this, it's useful for you:

apply plugin: 'com.android.application' 


dependencies {

    compile 'com.google.android.gms:play-services:11.2.0'
    compile 'com.google.android.gms:play-services-maps:11.2.0'
    compile 'com.google.android.gms:play-services-location:11.2.0' 
}

Upvotes: 3

Dream Developer
Dream Developer

Reputation: 410

Few days ago had same problem and have tried

dependencies {
compile 'com.google.android.gms:play-services:11.2.0'
compile 'com.google.android.gms:play-services-maps:11.2.0'
compile 'com.google.android.gms:play-services-location:11.2.0' 
}

but I keep getting error, so therfore I tried

 dependencies {
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    compile 'com.google.android.gms:play-services-location:10.0.1' 
    }

although it is old version but worked for me so I suggest you to try.

Upvotes: 3

Tawanda Muzavazi
Tawanda Muzavazi

Reputation: 495

You would then need to compile it direct from the site. So edit the dependencies in the build gradle file:

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.5.87'
}

You can try this. Hope it works.

Upvotes: 2

LAMRIN TAWSRAS
LAMRIN TAWSRAS

Reputation: 302

Hopefully, you are looking for this. If you are unable to use API then use this compile for setting up.

apply plugin: 'com.android.application'
...

dependencies {
    compile 'com.google.android.gms:play-services:11.2.0'
}

for further read, this Google Play Service may helpful

Edit1 also, use this compile for using map API

com.google.android.gms:play-services-maps:11.2.0

Upvotes: 2

Prokash Sarkar
Prokash Sarkar

Reputation: 11873

You need to enable "Show Package Details" from SDK manager to see the available api levels. By default, this option is disabled from Android Studio 2.3.

enter image description here

Upvotes: 6

Related Questions