【问题标题】:gradle taking too long too build in android studiogradle在android studio中构建的时间太长
【发布时间】:2015-12-27 02:14:21
【问题描述】:

我最近在 Ubuntu 14.04 中安装了 android studio,并希望继续开发我一直在 windows 中开发的 android 应用程序。但是当我尝试打开一些项目时,构建起来需要很长时间。我已经等了将近一个小时,但它似乎仍然没有编译和构建。 请问有什么帮助吗?或关于可能是什么原因的建议。 非常感谢您的帮助。

这就是我的 build.gradle 的样子

// Top-level build file where you can add configuration options common to all sub-projects/modules.


buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {


 jcenter()


 }

}

【问题讨论】:

  • Gradle 控制台中是否显示任何内容? cpu 忙还是死锁了?
  • 您的项目是否依赖多个库?还要检查系统配置。如果 cpu 使用率接近 100%,请查看任务管理器。
  • @Tauqir gradle 控制台上什么都没有显示,我不认为我的 cpu 很忙,或者任何东西都死锁了,因为它可以毫无问题地打开其他项目。我不知道如何检查我的项目是否依赖于多个库。有什么帮助吗?谢谢
  • @user3229080,粘贴你的 build.gradle
  • Here is it// 顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。 buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' // 注意:不要将应用程序依赖项放在这里;它们属于 // 在单个模块 build.gradle 文件中 } } allprojects { repositories { jcenter() } }

标签: android android-studio ubuntu-14.04


【解决方案1】:

某些项目需要下载某些支持库/jar文件并安装。您必须在项目属性中取消勾选离线模式

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-06
    • 2021-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-22
    • 1970-01-01
    相关资源
    最近更新 更多