0
votes

when i create map google map activity in android studio... after creation it takes time for syncing gradle... then it show following error....

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

Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.android.support:support-v4:22.2.0. Searched in the following locations: 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 Required by: MrCabv1:app:unspecified > com.android.support:appcompat-v7:22.1.0 Could not find com.android.support:support-v4:22.2.0. Searched in the following locations: 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 Required by: MrCabv1:app:unspecified > com.google.android.gms:play-services:8.3.0 > com.google.android.gms:play-services-basement:8.3.0 Could not find com.android.support:mediarouter-v7:22.2.0. Searched in the following locations: 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 Required by: MrCabv1:app:unspecified > com.google.android.gms:play-services:8.3.0 > com.google.android.gms:play-services-cast:8.3.0

1
Paste your build.gradle for the application please - Eamon Scullion
build.gradle(Project:ABC) / Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } - Muhammad Jamal
Paste as an edit in your post; easier to read. Also paste the build.gradle for the overall application and not for specific modules - Eamon Scullion
build.gradle (Module:App) apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "myapp" minSdkVersion 16 targetSdkVersion 21 versionCode 1 versionName "1.0 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'} }} dependencies {compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.1.0' compile 'com.google.android.gms:play-services:8.3.0'} - Muhammad Jamal
these were two gradle files in my app - Muhammad Jamal

1 Answers

0
votes

Well, it means you does not assign any or wrong dependencies for

com.android.support:support-v4:22.2.0  

and

com.android.support:mediarouter-v7:22.2.0

Solution. Go to Gradle Script -> build.gradle(Module:app) -> dependencies and add the correct version to build.gradle according to the API needs(Your SDK API). Make sure it is correct i.e compileSDKVersion 23 and buildToolsVersion "23.0.2" so you need

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

Refer failed to resolve com.android.support:appcompat-v7:22 and com.android.support:recyclerview-v7:21.1.2

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