Curious Droid
Curious Droid

Reputation: 111

Updating Google Play Services in lib module

Updating old project's Google Play Services plugin to com.google.gms:google-services:3.0.0, I'm running into the following problem:

My project has a lib module shared by other app modules, whose gradle build file is:


apply plugin: 'com.android.library'
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 22
        versionName "2.11"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.google.android.gms:play-services-location:10.0.1'
    compile 'com.google.android.gms:play-services-wearable:10.0.1'
}

When building the project, I get the following errors:

Error:(54, 41) error: package com.google.android.gms.maps.model does not exist

Error:(770, 19) error: cannot find symbol class LatLng

Reverting to:

compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.android.gms:play-services-wearable:9.0.0'

Everything works fine.

Any idea?

Upvotes: 1

Views: 163

Answers (1)

EJK
EJK

Reputation: 12527

It looks like the LatLng class has moved to a new location. Add the following to your build file:

compile 'com.google.android.gms:play-services-maps:10.0.1'

This will download the component containing that class and your compilation should succeed.

Upvotes: 2

Related Questions