如何解决此错误:无法解决:com.android.support:appcompat-v7:26.1.0

阿纳托利

我刚刚安装了 Android Studio 3.0.1 并且我从上次被问到这个问题时尝试了许多解决方案,但似乎没有一个有效。我仍然收到此错误:无法解决:com.android.support:appcompat-v7:26.1.0

我的顶级构建文件如下:

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

    allprojects{
        repositories{
            jcenter()
        }
    }
    repositories {
        // Gradle 4.1 and higher include support for Google's Maven repo using
        // the google() method. And you need to include this repo to download
        // Android plugin 3.0.0 or higher.
        maven { url "https://maven.google.com" }
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}

我的应用 build.gradle 文件包括:

apply plugin: 'com.android.application'

repositories {
    maven { url "https://maven.google.com" }
    jcenter { url "http://jcenter.bintray.com/" }
}

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"

    defaultConfig {
        applicationId "com.example.application"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
    buildTypes {

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:26.0.1'
    compile 'com.android.support:design:23.1.1'
}
垫页

您的项目build.gradle应该与此类似

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:3.0.1"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

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

您应该为您的库使用相同的版本,如下所示:

implementation "com.android.support:appcompat-v7:26.0.1"
implementation "com.android.support:design:26.0.1"

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

错误:(26、13)无法解决:com.android.support:appcompat-v7:25.0.1

如何解决无法找到参数 [com.android.support:appcompat-v7:28.0.0] 的方法 implementation() 问题?

Android appcompat v7错误

错误:(39、13)无法解决:com.android.support:appcompat-v7:26.0.0

错误:(24,11)无法解决:com.android.support:appcompat-v7:8.0.+

错误:(30, 13) 无法解决:libs/com.android.support:appcompat-v7:22.2.1

'错误:无法解决:com.android.support:appcompat-v7:29.0.1'

无法解决:com.android.support:appcompat-v7.27.+

Lollipop仅崩溃“以下错误的解决方法:Landroid / support / v7 / appcompat / R $ styleable”

NoClassDefFoundError:无法解决以下问题:Landroid / support / v7 / appcompat / R $ styleable

更新 SDK:无法解决:com.android.support:appcompat-v7

无法解决:com.android.support:appcompat-v7:15.+

无法解决:com.android.support:appcompat-v7:27.+

无法解决:com.android.support:appcompat-v7:27.0.2

无法解决:com.android.support:appcompat-v7:27.1.1

无法解决:com.android.support:appcompat-v7:25.4.0

无法解决:com.android.support:appcompat-v7:31.0.0

无法解决:com.android.support:appcompat-v7:jar

无法解决:“com.android.support:appcompat-v7”不管我做什么

无法解决:com.android.support:appcompat-v7:28.0

无法解决:com.android.support:appcompat-v7 24.0.1

无法解决:com.android.support:appcompat-v7:30.0.0

无法解决:com.android.support:appcompat-v7:24.4.0

无法解决:com.android.support:appcompat-v7:21.0.1

如何从Android appcompat v7 21库实现DrawerArrowToggle

无效的文件:android-sdk-linux / extras / android / support / v7 / appcompat / build.xml

Gradle同步失败-无法解决:appcompat-v7:26

错误:重复的类:android.support.v7.appcompat.R

实施'com.android.support:appcompat-v7:28.0.0'