大部分Android开发者必须已得到谷歌的消息更新应用程序由2019年八月,支持64位架构的详细说明,这里给出:Ensure that your app supports 64-bit devices
在我的应用程序,我发现了32位库被使用并且因此,我必须更新该应用支持64位体系结构。作为指南建议以上,我加入build.gradle
文件中:
ndk.abiFilters = 'armeabi-v7a' 'arm64-v8a' 'x86' 'x86_64'
然而,在那之后,我得到了构建应用以下错误:
错误:(35,0)找不到方法armeabi-V7A()为参数[arm64-V8A]上DefaultConfig_Decorated {名称=主,尺寸= NULL,的minSdkVersion = DefaultApiVersion {mApiLevel = 16,mCodename = '空'},targetSdkVersion = DefaultApiVersion {mApiLevel = 28,mCodename = '空'},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}的键入com.android.build.gradle.internal.dsl.DefaultConfig。
是否有人已经尝试过更新应用到64位?任何想法,如何解决这个问题?
它可以通过更新的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原生和反应,本机应用程序测试此。构建成功并应用在工作。
据NdkOptions,abiFilters
被定义为Set<String>
Set<String> abiFilters
在Groovy,Set
使用下面的语法(如果你想使用运营商=
')初始化:
Set<String> mySet = ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]