Build file 'C:\Users\shaoxiukun\Desktop\musictherapy-new-app\android\build.gradle' should not contain a package statement.
时间: 2023-11-22 19:06:14 浏览: 29
这个错误是因为在build.gradle文件中包含了package语句,而这个语句只能在Java文件中使用。要解决这个问题,需要在build.gradle文件中删除package语句。
以下是一个示例build.gradle文件,其中不包含package语句:
```gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
```