android - 错误 : Could not find method armeabi-v7a() for arguments [arm64-v8a]

标签 android android-studio 32bit-64bit

我试图更改我的应用程序以支持 32 位和 64 位,但是当我像这样更改 build.gradle 时。

android {
compileSdkVersion 28
defaultConfig {
    applicationId "id.co.poslogistics.agendakegiatan"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    ndk.abiFilters = 'armeabi-v7a' 'arm64-v8a' 'x86' 'x86_64'
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

但是当我gradle它时,错误会这样显示

错误:

Could not find method armeabi-v7a() for arguments [arm64-v8a] on DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=DefaultApiVersion{mApiLevel=15, mCodename='null'}, targetSdkVersion=DefaultApiVersion{mApiLevel=28, mCodename='null'}, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=1, versionName=1.0, applicationId=id.co.poslogistics.agendakegiatan, testApplicationId=null, testInstrumentationRunner=null, testInstrumentationRunnerArguments={}, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}, mWearAppUnbundled=null} of type com.android.build.gradle.internal.dsl.DefaultConfig.

谁能帮帮我。谢谢

最佳答案

您的配置

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

应该是

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

ndk {
    abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' ,'x86_64'
}

关于android - 错误 : Could not find method armeabi-v7a() for arguments [arm64-v8a],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54565105/

相关文章:

android - 应用程序个人文件夹路径在哪里

不支持虚拟化技术的硬件上的 Android Studio

android - 工具栏盲区

c++ - 为什么 “alignment”在32位和64位系统上相同?

.net - 在混合托管/非托管环境中支持多种架构的最佳方式是什么?

android - 以编程方式读取位于 android/app/sample.properties 文件的文件

java - 如何在 Firebase 实时数据库中存储用户的提供商帐户?

android - 即使应用程序关闭,如何保持 CountDownTimer 运行?

java - 无法从静态上下文中引用非静态方法 isGooglePlayServicesAvailable 和 getErrorDialog

debugging - 如何调试 (GDB) 64 位应用程序的 32 位部分?