2
votes

My google maps are not setting up on my android studio! I have check many solutions here and have followed each of them but still have no luck.

It's mainly from the googleplay services and repository dependencies that is causing the problem. I tried many solutions but it didn't work. I will post the error logs.

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: https://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom https://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/P:/Software/Android SDK/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/P:/Software/Android SDK/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/P:/Software/Android SDK/extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/P:/Software/Android SDK/extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar Required by: demomap:app:unspecified > com.android.support:appcompat-v7:21.0.3 Could not find com.android.support:support-v4:22.2.0. Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom https://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/P:/Software/Android SDK/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/P:/Software/Android SDK/extras/android/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar file:/P:/Software/Android SDK/extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom file:/P:/Software/Android SDK/extras/google/m2repository/com/android/support/support-v4/22.2.0/support-v4-22.2.0.aar Required by: demomap:app:unspecified > com.google.android.gms:play-services:7.8.0 > com.google.android.gms:play-services-base:7.8.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:/P:/Software/Android SDK/extras/android/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.pom file:/P:/Software/Android SDK/extras/android/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.aar file:/P:/Software/Android SDK/extras/google/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.pom file:/P:/Software/Android SDK/extras/google/m2repository/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.aar Required by: demomap:app:unspecified > com.google.android.gms:play-services:7.8.0 > com.google.android.gms:play-services-cast:7.8.0

Build-Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.sonyvaio.demomap"
        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:21.0.3'
    compile 'com.google.android.gms:play-services:7.8.0'
}
1
Was one of the solutions you tried looking for this library? com.android.support:support-v4:22.2.0.Stephan Branczyk
You need to have downloaded Google API android support library an Google repositories via SDK ManagerKISHORE_ZE
post your build.gradleStas Parshin
well i have it installed! but if you closely look, the error path is inside the google repository and i have both google play services and repositories installed and updated!CodexRat
@pengrad posted my build.gradleCodexRat

1 Answers

2
votes

Your build.gradle is correct.
Just install this two Extras from Android SDK Manager

android sdk manager