androidandroid-appcompatbuildbox

Failed to resolve: appcompat-v7 android studio 3.2.1


I exported my Build box project and opened it on Android studio. But Unable to Build it.I'm getting this error.

Failed to resolve: appcompat-v7

Gradle file

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "com.test.test1"
        minSdkVersion 16
        targetSdkVersion 26
        multiDexEnabled true

        ndk {
            moduleName "player_shared"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    implementation 'com.google.android.gms:play-services:+'
    implementation 'com.android.support:multidex:1.0.3'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    // More deps here //
}

anyone know how to fix this ?


Solution

  • Add this in dependencies:

    implementation 'com.android.support:appcompat-v7:27.1.1'
    

    Add this in project gradle

    allprojects {
      repositories {
      jcenter()
      maven { url "https://jitpack.io" }
      google()
      }
    }