【发布时间】:2021-01-14 17:08:43
【问题描述】:
我正在做的项目是很久以前开发的,并且运行成功。现在,我想再次访问它并运行它以查看一些结果。
当我尝试构建项目时,我收到以下错误和 Connection_Reset" 消息。
更新了 gradle:app:
plugins{
id 'com.android.application'
}
android {
compileSdkVersion 30
defaultConfig {
applicationId "example.com.thninxnet_00"
minSdkVersion 14
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion "30.0.2"
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:23.4.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation files('libs/universal-image-loader-1.9.5.jar')
}
更新了 gradle:project:
// 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:4.1.1'
// 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
}
更新错误:
connection reset
【问题讨论】:
-
您可能还需要在
allprojects.repositories下添加google()。 -
我想你已经从
github拉了它。 Git 不会保存您的受保护文件。这意味着当您将项目推送到 github 时,一些源代码会自动删除。根据您给出的那张图片,问题出在您的依赖项中(在实施上有问题)。照@maurice 说的做。我认为某些库丢失并尝试再次同步。 -
@maurice 实际上现在我收到了上面提到的那个错误。你明白了吗?
-
@LetsamrIt 您在版本控制中遇到问题。原因,那个项目是旧版本的,现在你正在使用
jar的更新版本和一些互联网库。我不知道如何解决这个问题。所以,对不起! -
你把 google() 放在 jcenter() 上面
buildscript和allprojects
标签: android gradle android-gradle-plugin build.gradle