[英]Error:(16, 0) Could not find method android() for arguments on root project 'delta-bartalk' of type org.gradle.api.Project
I am trying to view a layout in a project. 我正在尝试查看项目中的布局。 The layout shows no images.
布局显示没有图像。 Everytime I open the project I get an error right now the error being shown is
每当我打开项目时,我现在都会收到错误,显示的错误是
Error:(16, 0) Could not find method android() for arguments [build_6r57r9htisolgl7blgqlf257v$_run_closure2@22204001] on root project 'delta-bartalk' of type org.gradle.api.Project.
错误:(16,0)无法在org.gradle.api.Project类型的根项目'delta-bartalk'上找到参数[build_6r57r9htisolgl7blgqlf257v $ _run_closure2 @ 22204001]的方法android()。
Open file (link to // Top-level build file where you can add configuration options common to all sub-projects/modules.)
打开文件(链接到//顶级构建文件,您可以在其中添加所有子项目/模块共有的配置选项。)
I am a beginner with Android studio so I have no idea what to do. 我是Android工作室的初学者,所以我不知道该怎么做。
Thanks 谢谢
_------------------------------------------------------------------------------- _------------------------------------------------- ------------------------------
Theses are the files - first Top-level build file Name: delta-bartalk 论文是文件 - 第一个顶级构建文件名称:delta-bartalk
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.android.application' //[change recommended by comment from Eugen Martynov]
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
android {
}
dependencies {
}
This next code is called bartalk\\build.gradle 下一个代码称为bartalk \\ build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 17
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
In your top level file you have to remove 在您的顶级文件中,您必须删除
android { } dependencies { }
And 和
apply plugin: 'com.android.application'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.