更新到3.2.1后,android studio gradle同步错误

时间:2018-12-11 16:38:33

标签: android android-studio gradle

我有一个运行良好的android项目,但是突然我遇到了一些错误,这些错误使我将android studio更新为3.2.1,并将gradle升级为4.6。我的代码与我的同事(所有代码和版本)相同,除了gradle中的一行会在以后解释,他可以轻松构建,但由于以下错误我无法做到:

Failed to resolve: espresso-core
Open File


Failed to resolve: multidex-instrumentation
Open File

app.gradle:

    apply plugin: 'com.android.application'
    android {
        compileSdkVersion 27
        buildToolsVersion '28.0.3'
        defaultConfig {
            applicationId "com.arnick.bazim"
            minSdkVersion 15
            targetSdkVersion 27
            versionCode 1
            versionName "0.7"
            multiDexEnabled true
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            manifestPlaceholders = [onesignal_app_id               : "xxxxxxxxxxxxxx",

                                    onesignal_google_project_number: "REMOTE"]
        }
        applicationVariants.all { variant ->
            variant.resValue "string", "versionName", variant.versionName
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    repositories {
        jcenter()
    }
    dependencies {
        implementation 'com.android.support:recyclerview-v7:27.1.1' 
// the above line is showing error to me, error is about some version mismatching
// even by doing what it says the error does not disappear
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
        implementation 'com.stephentuso:welcome:1.4.1'
        implementation 'co.ronash.android:pushe-base:1.4.0'
        implementation 'com.google.android.gms:play-services-gcm:16.0.0'
        implementation 'com.google.android.gms:play-services-location:16.0.0'
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:multidex:1.0.3'
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:cardview-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support:support-v4:27.1.1'
        implementation 'com.android.support:customtabs:27.1.1'
        implementation 'com.google.android.gms:play-services-auth:16.0.1'
        implementation 'com.google.code.gson:gson:2.8.2'
        implementation('io.socket:socket.io-client:1.0.0') {
            // excluding org.json which is provided by Android
            exclude group: 'org.json', module: 'json'
        }
        implementation 'com.android.volley:volley:1.1.0'
        testImplementation 'junit:junit:4.12'
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    }

    apply plugin: 'com.google.gms.google-services'

项目gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

我已经清理,重新构建,使缓存无效并重新启动,以及我在网上看到的所有内容。我什至将Maven reposiroty url更改为其他2或3,但是错误仍然存​​在。我该怎么办? tnx

0 个答案:

没有答案