APP_ABI ignored
Asked Answered
C

1

3

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.

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

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)

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

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

did i miss something ?

Chapple answered 10/8, 2017 at 2:3 Comment(0)
C
8

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

Chapple answered 10/8, 2017 at 4:2 Comment(2)
Right! The Gradle plugin overrides some parameters that we normally set in Application.mkCommutation
@AlexCohn Indeed, it's killing me... Many people have mistake with putting the APP_ABI in Android.mk not Application.mk and solved it as soon as they moved it. But this one just won't gone until I did that.Chapple

© 2022 - 2024 — McMap. All rights reserved.