GeoApiContext and DirectionsApiRequest not found

2.1k views Asked by At

What dependencies are needed for these two classes to be used within my Android App? Below, is my current build.gradle file:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.volley:volley:1.1.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:design:26.1.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.maps.android:android-maps-utils:1.0.2'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'

    //UI Dependencies
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.navigation:navigation-fragment:2.2.2'
    implementation 'androidx.navigation:navigation-ui:2.2.2'

    //testing frameworks
    implementation 'junit:junit:4.13'
    testImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test:core:1.2.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    testImplementation "org.robolectric:robolectric:4.2.1"

    //API Dependencies
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.github.GrenderG:Toasty:1.4.2'
    implementation 'com.squareup.retrofit2:retrofit:2.8.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.7.0'

    //Directions API
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
}

However, I still get "Cannot resolve symbol: GeoApiContext" and "Cannot resolve symbol: DirectionsApiRequest".

I have added Google Maven repository, but no luck:

repositories {
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }

Thank you for your kind help.

1

There are 1 answers

1
Lorenzo Battilocchi On BEST ANSWER

Figured it out.

I was missing dependency implementation 'com.google.maps:google-maps-services:0.1.3' in my build.gradle file