昨天,在更新NDK之后,出现了以下错误:

Error:(81) Android NDK: Application targets deprecated ABI(s): armeabi
Error:(82) Android NDK: Support for these ABIs will be removed in a
future NDK release.

该链接将我定向到行上的setup-app.mk文件
_deprecated_abis := $(filter $(NDK_DEPRECATED_ABIS),$(NDK_APP_ABI))
ifneq ($(_deprecated_abis),)
  $(call __ndk_warning,Application targets deprecated ABI(s):
  $(_deprecated_abis))
  $(call __ndk_warning,Support for these ABIs will be removed in a
  future NDK release.)
endif

我不知道如何解决这个问题。
有什么建议吗?

最佳答案

我遇到了同样的问题,只是避免清理或重建整个项目,直到获得最新的NDK更新,问题才重新出现。

发生这种情况是因为,即使删除了目标,在app/.externalNativeBuild中仍然存在引用它们的文件。

为了解决这个问题,我删除了Application.mk(用于设置目标),并将此行添加到app/build.gradle

android {
    defaultConfig {

        // ...

        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a' // 'x86', 'x86_64' may be added
        }
   }

   // ...

    task ndkClean(type: Delete) {
        // remove unused archs from build cache
        delete fileTree('.externalNativeBuild') {
            exclude defaultConfig.ndk.abiFilters.collect { '**/' + it }
        }
    }
    tasks.findByPath(':clean').dependsOn ndkClean
}

10-05 18:10
查看更多