我是一名计算机科学专业的学生,我正试图通过暑期爱好熟悉建筑应用程序。然而,在过去的几天里,当我尝试同步Gradle时,它会给我同样的错误,说明
无法下载gradle-core.jar。
我将在这篇文章的底部发布完整的错误消息。
当然,我确保我没有在离线模式下工作。最重要的是,我强制使用超文本传输协议获取https://
源。我还改变了https://
为分发Url超文本传输协议://在gradle-wrapper.properties
文件。我尝试了不同的代理,并将build.gradle
文件中的存储库更改为具有jcenter()、mavenCentral()和google()。
我甚至尝试与我的防火墙和防病毒软件同步,但没有任何效果。下面您将看到我的整个错误消息。
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'AndroidStudioProjects'.
...
at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:64)
... 84 more
Caused by: org.gradle.internal.resolve.ArtifactResolveException: Could not download gradle-core.jar (com.android.tools.build:gradle-core:3.1.3)
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveArtifact(ExternalResourceResolver.java:506)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:409)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleComponentRepositoryAccess.resolveArtifact(BaseModuleComponentRepositoryAccess.java:65)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedModuleComponentRepository$CachedAccess.resolveArtifact(InMemoryCachedModuleComponentRepository.java:124)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveArtifact(ErrorHandlingModuleComponentRepository.java:171)
...
... 6 more
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle-core/3.1.3/gradle-core-3.1.3.jar'.
at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74)
at org.gradle.internal.resource.ResourceExceptions.getFailed(ResourceExceptions.java:57)
at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.withContentIfPresent(AccessorBackedExternalResource.java:146)
...
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveArtifact(ExternalResourceResolver.java:499)
... 27 more
Caused by: javax.net.ssl.SSLException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:596)
at sun.security.ssl.InputRecord.read(InputRecord.java:532)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:139)
at org.apache.http.impl.io.SessionInputBufferImpl.read(SessionInputBufferImpl.java:200)
...
at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.withContentIfPresent(AccessorBackedExternalResource.java:137)
... 44 more
(编辑):下面是我的相关文件
build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.30'
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle-wrapper.properties:
#Tue Jun 26 21:50:19 MDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-4.4-all.zip
gradle.properties:
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
settings.gradle:
include ':app'
本地物业:
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=C\:\\Users\\jddah\\AppData\\Local\\Android\\Sdk
将项目级gradle插件版本更新为最新版本并重新生成项目。。
classpath 'com.android.tools.build:gradle:3.2.1'
检查你是否打对了。如果仍然无法工作,请查看Android Gradle插件发行说明,以找到正确的Gradle插件版本。https://developer.android.com/studio/releases/gradle-plugin
在我的例子中,对于gradle: 2.2.3
allprojects {
repositories {
maven { url 'https://maven.google.com' } // now here
mavenLocal()
jcenter()
maven { url "$rootDir/../node_modules/react-native/android" }
maven { url 'https://maven.google.com' } // was here
}
}
希望有帮助:)
尝试将google()
作为第一次回购,如下所示。不要将它放在现有Android Studio项目的jcenter()
和mavenCentral()
下。
repositories {
google() // make this repo as the first one if Android Gradle Plugin is upgraded from 2.x to 3.x.
jcenter()
mavenCentral()
}
对于那些React Native或CordovaLib项目与Android Gradle插件较低版本,例如:2.2.3,你可以尝试用下面替换google()
,但是记得把它作为第一个回购选择。
repositories {
// google()
maven {
url "https://maven.google.com"
}
jcenter()
}
清理所有旧的.gradle
缓存,然后执行新的同步。
问题内容: 我试图熟悉夏季爱好的构建应用程序。但是,在过去几天中,当我尝试同步Gradle时,出现了相同的错误,指出 gradle-core.jar无法下载。 我将在这篇文章的底部发布完整的错误消息。 当然,我确保我不在离线模式下工作。最重要的是,我强迫使用来获取源。我还将文件中distributionUrl 更改为。我尝试了不同的代理,并已将build.gradle文件中的存储库更改为. 我什至
我有一个简单的任务,它创建了一个bat文件,任务名以“server”开头,当执行bat文件时,gradle jobs启动,代码如下: 这个任务曾经工作了一段时间,但现在我开始得到这个错误同步失败:文件找不到StackTrace下面: 我尝试删除项目工作空间中的. gradle文件夹并重新创建它,但它不起作用。重新启动机器和eclipse也没有帮助。 更新:我正在使用gradle 4.5,这似乎是一
组织。喷气式飞机。插件。格拉德尔。设置。无法将渐变设置转换为组织。喷气式飞机。插件。格拉德尔。设置。尝试构建新项目时发生渐变设置错误 我手动下载http://services.gradle.org/distributions/gradle-1.6-bin.zip并将zip内容复制到C:\Program Files(x86)\Android\android-dios\plugins\gradle文件
我对Android Studio非常陌生,我基本上是在尝试打开一个我已经下载并编译/运行的现有项目。当Gradle尝试同步时,我得到以下错误... 我在网上研究并尝试了几种解决方案,但都没有解决我的问题:/我还尝试过“使缓存无效并重新启动”,但也不起作用…… 这是我的清单: 我的构建:分级:
我使用的是Android studio 1.3.1,无法同步Gradle项目错误: 我默认的和仍然显示这个错误,有人能告诉我为什么我得到这个错误吗?
我想知道如何增加IntelliJIDEA用于同步项目的Gradle Daemon进程的堆大小? 当前流程使用-Xms256m -Xmx512m 我已经换了包装纸。属性文件到: