How to fix ERROR: No signature of method: build_ap86oam3dut3pxce3x49rdtma.android()?

后端 未结 15 2109
野的像风
野的像风 2021-02-12 11:27

ERROR: No signature of method: build_ap86oam3dut3pxce3x49rdtma.android() is applicable for argument types: (build_ap86oam3dut3pxce3x49rdtma$_run_closure1) values: [build_ap86oam

相关标签:
15条回答
  • 2021-02-12 12:01

    Make sure you are using the kotlin android plugin instead of the kotlin jvm plugin.

    apply plugin: 'kotlin-android' // NOT kotlin-jvm
    
    0 讨论(0)
  • 2021-02-12 12:01

    I added debug under buildTypes in the gradle file and missed a comma after "API_URL":

    not working:

    buildTypes {
        ...
        debug {
            buildConfigField "String", "API_URL" "\"http://myapi.com/\""
        }
    }
    

    working:

    buildTypes {
        ...
        debug {
            buildConfigField "String", "API_URL", "\"http://myapi.com/\""
        }
    }
    

    good luck!

    0 讨论(0)
  • 2021-02-12 12:01

    Best thing you can do is comment parts of your build.gradle file related to the issue until you get a good build and them uncomment 1 by 1 until you find the problem. I had the same error and it was related with a typo in one of the app build.gradle blocks. I was using:

    android {
        ...
        buildFeature {
            ...
        }
    }
    

    instead of

    android {
        ...
        buildFeatures {
            ...
        }
    }
    

    Good luck!

    0 讨论(0)
提交回复
热议问题