APP_ABI 被忽略 [英] APP_ABI ignored

查看:22
本文介绍了APP_ABI 被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的是android-ndk-r13b,我是直接从Android网站下载的(不是从SDK管理器下载的),然后在Android Studio的Project Structure中设置路径.

I used android-ndk-r13b, I downloaded it from Android website directly (not from SDK manager) and set the path from Project Structure in the Android Studio.

它能够检测到我的 Android.mk 和 Application.mk(都在我的 jni 文件夹中),我从控制台日志中看到了它.在我的 Application.mk 中,我定义了这个:APP_ABI:=armeabi-v7a

It able to detect my Android.mk and Application.mk (both in my jni folder), I saw it from console log. In my Application.mk, I define this : APP_ABI:=armeabi-v7a

但是从控制台日志可以看出,每次执行 ndk-build 时,总是有 APP_ABI:=mips64 作为参数.所以,总是有错误.(我猜是因为这个错误的参数,我得到了错误链接器命令失败...",因为我为 armeabi-v7a 编译了 .a 和 .so,而不是 mips64)

But from the console log, I could see that everytime it execute ndk-build, there is always APP_ABI:=mips64 as the parameter. So, there is always an error. (I guess it is because of this wrong parameter, I got error "linker command failed...", because I compiled the .a and .so for armeabi-v7a not mips64)

那么,我想知道是什么让我定义了 APP_ABI 的 Application.mk 被忽略了?(无论如何,我已经将 C++ 链接到我的 gradle)

So, I wonder what makes my Application.mk with APP_ABI defined is ignored ? (I already link the C++ to my gradle anyway)

我尝试使用:ndkBuild 中的参数APP_ABI:=armeabi-v7a"{}但是它说,没有arguments()之类的方法

I tried using: arguments "APP_ABI:=armeabi-v7a" in ndkBuild{} But it said, there is no method such as arguments()

我错过了什么吗?

推荐答案

找到了!将此添加到 app.gradle 中的 defaultConfig {} =>ndk{abiFilters 'armeabi-v7a'}

Found it ! Add this inside defaultConfig {} in app.gradle => ndk{abiFilters 'armeabi-v7a'}

这篇关于APP_ABI 被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆