gpt4 book ai didi

android - 支持 64 位会导致在 build.gradle 中添加 ndk.abiFilters 时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:43:30 25 4
gpt4 key购买 nike

大多数 Android 开发人员一定已经从谷歌那里得到消息,要求在 2019 年 8 月之前更新应用程序以支持 64 位架构。详细说明如下: Ensure that your app supports 64-bit devices

在我的应用程序中,我发现使用了 32 位库,因此我必须更新应用程序以支持 64 位架构。按照上面指南中的建议,我在 build.gradle 文件中添加了以下内容:

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

但是,之后,我在构建应用程序时遇到以下错误:

Error:(35, 0) Could not find method armeabi-v7a() for arguments [arm64-v8a] on DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=DefaultApiVersion{mApiLevel=16, mCodename='null'}, targetSdkVersion=DefaultApiVersion{mApiLevel=28, mCodename='null'}, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=3, versionName=1.2, applicationId=, 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.

有没有人尝试过将应用程序更新到 64 位?知道如何解决这个问题吗?

最佳答案

可以通过更新build gradle defaultConfig来完成

defaultConfig {
applicationId "my.test.64bitapp"
minSdkVersion 15
targetSdkVersion 26
versionCode 42
versionName "1.0.2"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' ,'x86_64'
}

defaultConfig {
applicationId "com.swypmedia"
minSdkVersion 16
targetSdkVersion 26
versionCode 2
versionName "2.0.2"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' ,'x86_64'
}
}

我已经在 android-native 和 react-native 应用上测试过了。构建成功,应用程序正常运行。

关于android - 支持 64 位会导致在 build.gradle 中添加 ndk.abiFilters 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54476308/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com