gpt4 book ai didi

java - Android Studio 3.0.1 Gradle同步失败:原因:org.gradle.util.GFileUtils.unpack(Ljava/lang/Object;)Ljava/lang/Object;

转载 作者:行者123 更新时间:2023-12-03 05:48:56 25 4
gpt4 key购买 nike

我的Android Studio在gradle中有问题。
我开始忙于离线工作。为了获得我选择的gradle版本...

我试图改变我的

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1.zip




distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-rc-5.zip


之后,它开始刷新我的Android工作区,现在终于完成了,这给了我一个错误

Gradle sync failed: Cause: org.gradle.util.GFileUtils.unpack(Ljava/lang/Object;)Ljava/lang/Object;
Consult IDE log for more details (Help | Show Log) (10s 384ms)



Error:Unable to find method 'org.gradle.util.GFileUtils.unpack(Ljava/lang/Object;)Ljava/lang/Object;'.

Possible causes for this unexpected error include:

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.


我在上面尝试了这些方法,但其中任何一个都不起作用

gradle-wrapper.properties

#Sun Nov 26 15:02:51 PST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-rc-5.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


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:4.4-rc-5'


// 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
}


Settings.gradle

include ':app'

最佳答案

我知道这是我自己的问题,我做到了,但是现在我完全想出了解决该问题的方法。

[确保您的互联网连接正常!]

  • 关闭项目
  • 转到设置> Gradle>取消选中离线mod
  • 不要选择任何支持(例如C++)
  • 在构建Gradle信息时,转到"file">“设置”>“构建,执行,部署”>“Gradle
  • 选择本地gradle分布
  • 选择将提取的gradle放入的路径文件夹
  • (例如C:/ Program Files / Android / Android Studio / gradle / gradle-4.4-rc-5)
  • 然后应用

  • 它对我来说运行良好,现在,我的Android Studio重新下载了一些依赖项。

    关于java - Android Studio 3.0.1 Gradle同步失败:原因:org.gradle.util.GFileUtils.unpack(Ljava/lang/Object;)Ljava/lang/Object;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48716130/

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