首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在我的代码中找不到方法android导致R错误

在我的代码中找不到方法android导致R错误
EN

Stack Overflow用户
提问于 2018-10-10 06:44:09
回答 1查看 33关注 0票数 1

错误:(15,0)在根项目‘ud839_Miwok- build_41ptob9czd5ucux9ngzednsn4$_run_closure1@100eeb5 -build_41ptob9czd5ucux9ngzednsn4$_run_closure1@100eeb5’上找不到参数代码的android()方法。打开文件

我还试着用互联网连接重建gradle,

下面是我的build.gradle代码

代码语言:javascript
复制
// 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:2.1.0'

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

android {
buildToolsVersion "28.0.3"

}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-10 06:52:14

您的build.gradle文件属于项目级别。请将以下行移动到模块 build.gradle文件。

代码语言:javascript
复制
android {
  buildToolsVersion "28.0.3"
}

Detailed ref is here.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52730293

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档