如何修复错误:没有方法签名:build_ap86oam3dut3pxce3x49rdtma.android()?

新手上路,请多包涵

错误:没有方法签名:build_ap86oam3dut3pxce3x49rdtma.android() 适用于参数类型:(build_ap86oam3dut3pxce3x49rdtma\(_run_closure1) 值:\[build_ap86oam3dut3pxce3x49rdtma\)_run_closure1@47588b04]

构建等级是:

 apply plugin: 'com.android.application'

    android{
    implementationSdkVersion 28
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "com.uiresource.taksiku"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        }
    }

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        androidTestImplementation('com.android.support.test.espresso:espresso-core:2.3-alpha', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        implementation "com.android.support:appcompat-v7:$var"
        implementation 'com.android.support:design:28.0.0'
        testimplementation 'junit:junit:4.13'
        implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta5'
        implementation 'de.hdodenhof:circleimageview:3.1.0'
        }

原文由 Usman Liaqat 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 520
1 个回答

我正在使用 JAVA,但由于某种原因,Android Studio 在我不知情的情况下将 kotlinOptions 添加到 android 块中。然后发生了同样的错误。我放在这里以防万一有人需要。

 android {
    // ...

    // remove this block if you are using Java
    kotlinOptions {
        jvmTarget = '1.8'
    }

    // ...
}

原文由 Rem 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题