I was running my application and this error just showed up:
A problem occurred evaluating project ':audioplayers_android' No signature of method: build_dgdn03jnsclcv5nxgrmq5bcz.android() is applicable for argument types: (build_dgdn03jnsclcv5nxgrmq5bcz$_run_closure2) values:[build_dgdn03jnsclcv5nxgrmq5bcz$_run_closure2@32d98551]
There's something wrong in this file on my project:
group 'xyz.luan.audioplayers'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.7.10'
ext.coroutines_version = '1.6.4'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1"
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'de.mannodermaus.android-junit5'
android {
compileSdk 33
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty('namespace')) {
namespace 'xyz.luan.audioplayers'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 16
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lint {
disable 'InvalidPackage'
}
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
dependencies {
implementation "androidx.core:core-ktx:1.9.0" // Do not pump unless dropping support for AGP7
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation 'org.assertj:assertj-core:3.23.1'
}
repositories {
mavenCentral()
}
The IDE says the error is on the line 31, the start of android part. I saw that there was some people with same issue, but, honestly, I tried all the solutions and solved nothing. Help ;(.
Thank you very much.