当前位置: 首页 > 知识库问答 >
问题:

将Android Studio更新到3.1.3后,在依赖项方面出现了一些错误

龚联
2023-03-14

嗨,我在构建上有一些错误...我是新来的在android工作室,我没有问题,直到我将我的android工作室更新到3.1.3...现在,我在gradle构建上播种错误关于无法解决依赖...

这是我的身材。gradle(模块:应用程序)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.shoaib.newsletters"
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    compile 'com.tomerrosenfeld.customanalogclockview:custom-analog-clock-view:1.1'
    compile 'com.android.volley:volley:1.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
}

还有我的身材。gradle(项目:)

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

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'


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

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

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

而且有错误

Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.2.
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test.espresso:espresso-core:3.0.2.
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File
Show Details

请告诉我如何解决这些问题。。。

共有1个答案

吕奇
2023-03-14

使用appcompact-v7:26.1.0时

约束布局版本必须为

implementation 'com.android.support.constraint:constraint-layout:1.0.2'

测试应该是

androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

如果这对您有帮助,请及时更新

 类似资料:
  • 我是Maven开发的初学者,需要我们的帮助来解决这个问题。我可以看到, 只有下面的罐子可用 我也得到下面的错误在 生成过程中发生错误。在项目“cim”上运行生成器“Maven Project builder”时出错。无法计算生成计划:插件组织。阿帕奇。专家plugins:maven resources plugin:2.6或其依赖项之一无法解析:无法读取组织的工件描述符。阿帕奇。专家插件:mave

  • 我正在使用maven eclipse插件来管理我的web应用程序项目的dependecies(eclipse WTP)。在更改依赖项时,我通常执行maven的copy-dependencies目标,将项目JAR复制到WebContent/WEB-INF/lib文件夹。当我更改pom文件中的依赖项时,是否有一种方法可以自动完成此操作?

  • 虽然在处理未解决的依赖项时存在许多问题,但似乎没有更新这些依赖项的通用方法。 您需要手工为每一个检查maven central,还是有一些漂亮的工具可以自动将它们更新到最新版本?

  • 我正在尝试将protobuf依赖项添加到我的maven项目中。我已经使用mvn install安装了protobuf jar文件:install-file-Dpackaging = jar \-DgeneratePom = true \ < br >-DgroupId = com . Google . proto buf \-DartifactId = proto buf-Java \-Dfile

  • 我昨天将android Studio更新到4.1,之后我无法在flutter中运行项目。在flutter医生上,错误显示在下面的屏幕截图中。但是我的flutter和dart插件已经安装好了。有人请帮帮我吗? 颤动医生截图