gpt4 book ai didi

exception - Gradle对等方未通过身份验证OutOfMemoryError:PermGen空间

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

我花了很多时间在Android Studio 1.3上,以能够运行一个项目。我遇到了很多问题,因此我想将它们放在一个地方,以便其他人可以从中受益并节省时间。

  • Android对等方未通过身份验证
  • Android Studio Gradle问题:OutOfMemoryError:PermGen空间
  • Gradle无法HEAD https://..pom>对等方未通过身份验证

  • 我会回答所有这些问题

    最佳答案

    Windows 8(64bit)上的Android Studio 1.3(64bit)

    1)安装Java 8(64位),然后卸载所有其他Java,删除旧Java的路径

    2)转到cmd并键入“java -version”,它应该打印1.8版本信息

    3)转到Environment Variables并定义两个变量

  • _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true
  • JAVA_HOME C:\Program Files\Java\jdk1.8.0_51

  • 4)打开Android Studio(如果有的话,关闭项目)项目默认值->项目结构,并设置Java和Android路径

    Project Structure

    5)在settings.gradle中仅包含您需要的项目,例如: include ':library-projects/android-az-progressbar', 'az-sample-trunk'
    6)如果您有大型项目,则需要在项目 .gradle文件 android { dependencies {下定义这些选项
    dexOptions {
    jumboMode true
    incremental true
    preDexLibraries false
    javaMaxHeapSize "4g"
    }

    7)现在转到 C:\Users\{your_user}\.gradle并创建一个名为“ gradle.properties”的新文件
    # Project-wide Gradle settings.

    # IDE (e.g. Android Studio) users:
    # Settings specified in this file will override any Gradle settings
    # configured through the IDE.

    # For more details on how to configure your build environment visit
    # http://www.gradle.org/docs/current/userguide/build_environment.html

    # The Gradle daemon aims to improve the startup and execution time of Gradle.
    # When set to true the Gradle daemon is to run the build.
    # TODO: disable daemon on CI, since builds should be clean and reliable on servers
    org.gradle.daemon=true

    # Specifies the JVM arguments used for the daemon process.
    # The setting is particularly useful for tweaking memory settings.
    # Default value: -Xmx10248m -XX:MaxPermSize=256m
    org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

    # 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

    # Enables new incubating mode that makes Gradle selective when configuring projects.
    # Only relevant projects are configured which results in faster builds for large multi-projects.
    # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand
    org.gradle.configureondemand=true

    #org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m

    8)现在,重新启动计算机,并根据需要使缓存无效/从文件菜单重新启动Android Studio

    关于exception - Gradle对等方未通过身份验证OutOfMemoryError:PermGen空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31848176/

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