gpt4 book ai didi

android - 升级到 Android Studio 到 2.0 Preview 并使用 Instant Run 后出现 Gradle 错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:09:06 25 4
gpt4 key购买 nike

当我尝试运行在 Android Studio 1.5 上运行良好的项目时,出现以下错误:

Error:Access to the dex task is now impossible, starting with 1.4.0
1.4.0 introduces a new Transform API allowing manipulation of the .class files.
See more information: http://tools.android.com/tech-docs/new-build-system/transform-api

我在这里看到了一些关于这个错误的问题,但所有答案都是将 Gradle 降级到 1.3 版本,我无法使用新的 Android Studio 和 Instant Run 选项。

这个问题还有其他解决方案吗?

最佳答案

我能够通过在我的 build.gradle 中扩大最大堆大小来解决这个问题将此添加到您的 android 闭包中:

 dexOptions {
javaMaxHeapSize "4g"
}

不确定它与新的 api 有什么关系

关于android - 升级到 Android Studio 到 2.0 Preview 并使用 Instant Run 后出现 Gradle 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33890308/

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