可能是什么问题?
我尝试更改buildTools的版本 那是我的 biuld.gradle
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.ban_hang'
compileSdk 33
buildToolsVersion "34.0.0"
defaultConfig {
applicationId "com.example.ban_hang"
minSdk 33
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation project(path: ':app')
implementation project(path: ':app')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.cardview:cardview:1.0.0"
}
两个潜在原因:
implementation project(path: ':app')
行指的是同一个项目。 (假设上面的内容是:app
模块的build.gradle
内容。)