My code:
// 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.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
allprojects {
repositories {
jcenter()
} }
task clean(type: Delete) {
delete rootProject.buildDir }
Here the error log:
Error:(1, 0) Cause: startup failed:
build file 'D:\Doctor\build.gradle': 1: Invalid variable name. Must start with a letter but was:
. At [1:1] @ line 1, column 1.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
^
1 error
<a href="openFile:D:\Doctor\build.gradle">Open File</a>
Copyright Notice:Content Author:「ZhangKuixun」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40711981/invalid-variable-name-error-in-android-build-grade