错误:无法在android studio 3.0.1中解析:appcompat-v7

错误:无法在android studio 3.0.1中解析:appcompat-v7,android,android-studio,gradle,android-gradle-plugin,Android,Android Studio,Gradle,Android Gradle Plugin,我面临着这个问题,我已经做了所有强制性的改变,但仍然面临 build.gradle(项目级) build.gradle(应用程序级) 确保所有支持库都有相同的版本。出现此错误的原因有多种 第一个问题可能是你的互联网工作不正常,因为我看到你使用了很多第三方图书馆,所以需要高速互联网下载 第二个问题可能是您的项目设置处于脱机模式,请通过转到文件->设置->构建、执行、开发并单击渐变来检查是否选中了“脱机”工作复选框 第三个是可能是缓存内存,只是使项目无效并重新启动转到文件->使缓存无效/重新启动

我面临着这个问题,我已经做了所有强制性的改变,但仍然面临

build.gradle(项目级)

build.gradle(应用程序级)


确保所有
支持库都有相同的版本。

出现此错误的原因有多种

第一个问题可能是你的互联网工作不正常,因为我看到你使用了很多第三方图书馆,所以需要高速互联网下载

第二个问题可能是您的项目设置处于脱机模式,请通过转到文件->设置->构建、执行、开发并单击渐变来检查是否选中了“脱机”工作复选框

第三个是可能是缓存内存,只是使项目无效并重新启动转到文件->使缓存无效/重新启动


希望此帮助

如果您将
google()
添加到应用程序级别的
存储库
,会发生什么?删除项目的.gradle、Delete.idea、app.iml的生成缓存包装器。通过回滚到gradle版本4.3,我能够解决此问题
buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven {
        url 'https://repo1.maven.org/maven2/'
    }
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 27
    buildToolsVersion '27.0.1'

    defaultConfig {
        applicationId "com.kiran.example.ebitcoin"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        // Enabling multidex support.
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true //support color.xml colors in vector image
    }

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

    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }

    useLibrary 'org.apache.http.legacy'
    // for EncodingUtils.getBytes(post_Data, "base64") in actrivitypaymentfrowebview

    sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/assets/font'] } }

    packagingOptions {
        exclude 'META-INF/rxjava.properties'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
}

dependencies {
    implementation 'com.google.firebase:firebase-messaging:11.0.4'
    implementation 'com.google.firebase:firebase-invites:11.0.4'
    implementation 'com.google.firebase:firebase-crash:11.0.4'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:27.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:27.0.1'
    compile 'com.android.support:support-v13:27.0.1'

    testCompile 'junit:junit:4.12'
    implementation 'com.android.support:cardview-v7:27.0.1'
    compile('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
        transitive = true;
    }
    compile 'com.flurry.android:analytics:11.0.0@aar'//flurry sdk of yahoo for crashalytics

    //compile 'com.google.code.gson:gson:2.3.1'
    //compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.android.support:animated-vector-drawable:27.0.1'
    //compile 'com.android.support:customtabs:27.0.1'
    //compile 'com.android.support:palette-v7:27.0.1'
    compile 'com.android.support:recyclerview-v7:27.0.1'
    //to store object in shared pref
    // compile 'com.google.code.gson:gson:2.7'
    // Retrofit
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    // JSON Parsing
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'

    //add ripple below API 21
    //compile 'com.balysv:material-ripple:1.0.2'
    //add this dependency to scan QR code
    compile 'com.journeyapps:zxing-android-embedded:3.4.0'
    //material dialog
    // compile 'me.drakeet.materialdialog:library:1.3.1'
    //for setting GIF image
    //compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
    //for material dialogs
    //implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
    //for sms otp
    //compile 'com.github.GoodieBag:Pinview:v1.3'

    //PayUMoney
    /* compile('com.payumoney.sdkui:plug-n-play:1.1.0') {
        transitive = true;
        exclude module: 'payumoney-sdk'
    }
    compile 'com.payumoney.core:payumoney-sdk:7.1.0'*/
    //for payment gateway
    compile 'com.android.volley:volley:1.1.0'
    //enable multiple methods
    compile 'com.android.support:multidex:1.0.0'
    //contry code selector
    //implementation 'com.hbb20:ccp:2.1.4'

    //appling font library to app
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'

    //file compression
    compile 'id.zelory:compressor:2.1.0'
    //async task test
    //compile 'com.loopj.android:android-async-http:1.4.9'
   // compile 'cz.msebera.android:httpclient:4.3.6'//upload images to api using this
    //progress dialog
    //compile 'com.github.d-max:spots-dialog:0.4'

    //to load
    compile 'com.github.bumptech.glide:glide:3.8.0'
    implementation files('libs/android-async-http-1.4.9.jar')
    implementation files('libs/android-async-http-1.4.9.jar')
}
apply plugin: 'com.google.gms.google-services'