No signatu-6ren">
gpt4 book ai didi

Android Studio 抛出 "No signature of method"错误,指向 build.gradle :app

转载 作者:行者123 更新时间:2023-12-04 23:47:23 24 4
gpt4 key购买 nike

尝试通过 Android Studio 运行 Kotlin 应用程序后出现此错误:

A problem occurred evaluating project ':app'.
> No signature of method: build_4blexxmb1pl0fsds689m8rkwz.android() is applicable for argument types: (build_4blexxmb1pl0fsds689m8rkwz$_run_closure1) values: [build_4blexxmb1pl0fsds689m8rkwz$_run_closure1@220b09f3]
错误将我指向 build.gradle:app 的这一部分文件(特别是带有 android { 的行):
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

buildFeatures {
viewBinding = true

defaultConfig {
applicationId "com.example.bitfighter"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildReleases {
viewBinding = true
}
此错误消息是什么意思,我可以更改什么来解决问题?

最佳答案

尝试像这样构造代码

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.example.bitfighter"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
viewBinding = true
}
defaultConfig 应该始终只在 android 中。子句而不是在 buildFeatures 中。除此之外,当您已经添加了 buildFeatures 子句时,您不需要 buildReleases 子句。

关于Android Studio 抛出 "No signature of method"错误,指向 build.gradle :app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67678550/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com