简体   繁体   中英

Gradle DSL method not found: 'arm64-v8a()' - unable to build

I'm experiencing a problem while opening a project. I have searched a lot of issues on this but not able to resolve this. Please help

I have tried to remove product flavors and updating gradle. Below is my error:

ERROR: Gradle DSL method not found: 'arm64-v8a()' Possible causes: The project 'Example' may be using a version of the Android Gradle plug-in that does not contain the method (eg 'testCompile' was added in 1.1.0). Upgrade plugin to version 3.4.1 and sync project

The project 'Example' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file

The build file may be missing a Gradle plugin. App-level gradle code:

Apply Gradle plugin

apply plugin: 'com.android.application'

android {
compileSdkVersion 28


defaultConfig {
    applicationId "com.example.kiosk"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 10
    versionName "10.0"
    vectorDrawables.useSupportLibrary=true
    multiDexEnabled true
    apply plugin: 'java'
    ndk.abiFilters 'armeabi-v7a' 'arm64-v8a' 'x86' 'x86_64'
}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}

}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
classpath 'com.android.tools.build:gradle:3.4.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-ads:18.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.karumi:dexter:5.0.0'
implementation 'me.dm7.barcodescanner:zxing:1.9.13'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.itextpdf:itextg:5.5.10'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}

I think your issue may be fixed by putting some commas between the params you are passing to ndk.abiFilters

It should look like so:

ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'

Also, I'm not sure that the line apply plugin: 'java' is useful. I think it can be removed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM