0

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

Muhammad Jamal
  • 442
  • 4
  • 21
  • Paste your build.gradle for the application please – Eamon Scullion Dec 09 '15 at 19:13
  • 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 Dec 09 '15 at 19:19
  • 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 Dec 09 '15 at 19:21
  • 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 Dec 09 '15 at 19:22
  • these were two gradle files in my app – Muhammad Jamal Dec 09 '15 at 19:23
  • Your module build.gradle file is missing a few of the dependencies mentioned in your error log such as 'com.android.support:support-v4:22.2.0'. Add these in the dependencies section. – Eamon Scullion Dec 09 '15 at 19:25
  • how can i add ?? this is the problem – Muhammad Jamal Dec 09 '15 at 19:40

1 Answers1

0

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

Community
  • 1
  • 1
Zubli Quzaini
  • 352
  • 1
  • 3
  • 17
  • shall i add this same as it is ? {compile 'com.android.support:mediarouter-v7:23.1.1' – Muhammad Jamal Dec 09 '15 at 19:39
  • It's depends on your compileSDKVersion and buildToolsVersion above.. If you are rocking API 23, then you should.. For more information, http://developer.android.com/tools/support-library/index.html – Zubli Quzaini Dec 09 '15 at 19:41
  • Have you change the compileSDKVersion and buildToolsVersion to the lastest update? – Zubli Quzaini Dec 09 '15 at 19:49