Android studio︰ 无法使用地图Activity

发布时间: 2016/9/26 4:28:26
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

在创建地图谷歌地图时 activityandroid studio...后创作需要 time 同步 gradle......,然后它显示下列错误...

Error:A problem occurred configuring project ':app'.

能不能解决所有的依赖项 configuration ':app:_debugCompile'。 找不到 com.android.support:support-v4:22.2.0。 在以下位置搜索︰ hhttps://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom hhttps://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/C:/Users/ABC/AppData/Local/Android/sdk/所需的 extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar: MrCabv1:app︰ 未指定 > com.android.support:appcompat-v7:22.1.0 找不到 com.android.support:support-v4:22.2.0。 在以下位置搜索︰ hhttps://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom hhttps://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/C:/Users/MABC/AppData/Local/Android/sdk/所需的 extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar: MrCabv1:app︰ 未指定 > com.google.android.gms:play-服务︰ 8.3.0 > com.google.android.gms:play-服务-地下室︰ 8.3.0 找不到 com.android.support:mediarouter-v7:22.2.0。 在以下位置搜索︰ https://jcenter.bintray.com/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.pom https://jcenter.bintray.com/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.aar file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.pom file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.aar file:/C:/Users/ABC/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.pom file:/C:/Users/ABC/AppData/Local/Android/sdk/所需的 extras/google/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.aar: MrCabv1:app︰ 未指定 > com.google.android.gms:play-服务︰ 8.3.0 > com.google.android.gms:play-服务-铸︰ 8.3.0

解决方法 1:

嗯,这意味着你不会分配任何或错了依赖项

com.android.support:support-v4:22.2.0  

com.android.support:mediarouter-v7:22.2.0

解决方案。去 Gradle Script 网站-build.gradle(Module:app)-依赖项 > 并将正确的版本添加到 build.gradle 根据 API 需要 (你 SDK API)。 请确保它是正确,即 compileSDKVersion 23 和 buildToolsVersion"23.0.2",所以你仍然需要

compile 'com.android.support:mediarouter-v7:23.1.1'

请参阅未能解决 com.android.support:appcompat-v7:22,com.android.support:recyclerview-v7:21.1.2

http://developer.android.com/reference/android/support/v7/media/MediaRouter.html

官方微信
官方QQ群
31647020