android - 找不到 GeoApiContext 和 DirectionsApiRequest
问题描述
在我的 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'
}
谢谢你的热心帮助。
解决方案
弄清楚了。
implementation 'com.google.maps:google-maps-services:0.1.3'
我的 build.gradle 文件中缺少依赖项
推荐阅读
- wpf - 如何在没有图像的情况下在 WPF 中制作具有透明背景和模糊效果的堆栈面板?
- java - Netty:如何捕获“java.io.IOException:对等连接重置”
- python - Python VLC - 下一个曲目
- java - 获取满足Java条件的下一个日期
- python - PyGame 没有响应,有什么提示吗?
- docker - 在 Windows 10 中使用 docker-desktop 时,CronJob 在容器内失败
- google-sheets - 行消失在复选框单击 GoogleAppscripts
- mongodb - MongoDBCompass shell 解释不支持详细参数
- r - 无法在 R 中卸载包(tidyverse 和其他)
- postgresql - 具有不同日期格式的 PostgreSQL COPY FROM csv