gpt4 book ai didi

android - 无法解决android studio中的所有依赖项

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:02:49 27 4
gpt4 key购买 nike

<分区>

我收到这些错误:-

错误:无法解析“:app@debug/compileClasspath”的依赖关系:无法解析 com.android.support:appcompat-v7:27.0.0。

错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖项:无法解析 com.android.support.test:runner:1.0.1。

错误:无法解析“:app@releaseUnitTest/compileClasspath”的依赖关系:无法解析 junit:junit:4.12。

错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法解析 com.android.support.test.espresso:espresso-core:3.0.1。

  1. 我尝试了很多方法,但它没有同步 gradle。
  2. 我也尝试过 GRADLE OFFLINE METHOD,但还是行不通。
  3. 我已尝试添加 GOOGLE MAVEN REPO 存储库,但没有成功。
  4. 我已经尝试了这里列出的所有这些方法:- Failed to resolve: com.android.support:cardview-v7:26.0.0 android

同步卡住的截图

SYNC STUCK AT THIS 1

SYNC STUCK AT THIS 2

SYNC STUCK AT THIS 3

SYNC STUCK AT THIS 4

我是 android studio 的新手,请忽略错误。

应用build.gradle文件:

    apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.firstapp.myapplication"
minSdkVersion 16
targetSdkVersion 27
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:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

应用build.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.0.0'


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

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

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

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com