找不到GeoApiContext和DirectionsApiRequest

问题描述 投票:0回答:1

要在我的Android应用程序中使用这两个类,需要什么依赖关系?下面是我当前的build.gradle文件:

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'
}

但是,我仍然收到“无法解析符号:GeoApiContext”和“无法解析符号:DirectionsApiRequest”。

我添加了Google Maven存储库,但没有运气:

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

谢谢您的帮助。

android google-maps-android-api-2 directions geoapi
1个回答
0
投票

想通了。

我缺少依赖项implementation 'com.google.maps:google-maps-services:0.1.3' 在我的build.gradle文件中

© www.soinside.com 2019 - 2024. All rights reserved.