所以我试图转移到android studio,但我一直收到这个错误。
这是我在日志中得到的唯一内容:
Error:Could not find method compile() for arguments [com.android.support:support-v4:20.0.0] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@50a8e746.
请从 Android SDK 安装 Android Support Repository
经理。打开 Android SDK 管理器
问题是我安装了 android support repo 以及几乎所有其他东西,所以我真的不知道如何解决这个问题。
我什至尝试删除 .gradle 并让它再次下载,但它没有解决任何问题。
这是我的 build.gradle(我确实对它进行了更改,因为我遇到了构建错误):// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { // do not use dynamic updating. compile 'com.android.support:support-v4:20.0.0' } } allprojects { repositories { jcenter() } }
安卓SDK:
最佳答案
不要将模块级依赖项放在 buildscript
中堵塞。 buildscript
block 用于构建系统本身的依赖项,即如果您要添加更多 Gradle 插件。要为您的模块添加依赖项,请将它们放在模块目录中的 build.gradle 文件中。
关于android - 0.8.0 Gradle 同步失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25146360/