android - 错误:在 android studio 上更改类路径后无法解决问题
问题描述
将 build.gradle 上的依赖项的类路径更改为 后3.3.2
,我收到此错误:
ERROR: Failed to resolve: com.android.support:appcompat-v7:28.0.0
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.android.support.constraint:constraint-
layout:1.1.3
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.android.support.test:runner:1.0.2
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: com.android.support.test.espresso:espresso-
core:3.0.2
Show in Project Structure dialog
Affected Modules: app
这是我的 build.gradle(Project: MyApplication) 文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//"/home/hb3hbahan1/Android-Studio/android-studio/gradle/gradle-3.3.2.pom"
google()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// 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
}
这是 build.gradle(Module: App) 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
}
编辑:我刚刚注释掉了除了 build.gradle(Module: app) 上的第 3 行之外的所有依赖项,并且错误消失了。这会影响我未来的调试等吗?
解决方案
推荐阅读
- python - 如何让我的 pygame 关卡更有效率?
- python - 与其他所有函数并行运行一个异步函数
- r - 是否有一种更简洁的方法可以在 R 中执行多个单样本 T 检验
- flutter - 使用矩阵改变图像的对比度是否正确?
- vb.net - 输入框未声明
- android - 为什么 ListAdapter 的 submitList 功能不起作用?
- .net - 无法加载源 https://api.nuget.org/v3/index.json 的服务索引
- google-sheets - 如何从日期范围中获取对应于第 26 周最后一天的值
- python - 泡菜情节 Python
- c - 为什么在 Windows 上运行的 Clang 没有 C 一致性(__STDC__ 未定义为 1)?