APP_ABI被忽略 [英] APP_ABI ignored

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

问题描述

我使用了android-ndk-r13b,我直接从Android网站(而不是从SDK管理器)下载了它,并从Android Studio中的项目结构"中设置了路径.

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而不是mips64编译了.a和.so)

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天全站免登陆