Linking various architectures libs in Projucer

Hi I have a bunch of libs for android, and they look like:
libAndroidarm64-v8a.a, libAndroidarmeabi-v7a.a, etc.

I’m using the “External libraries to link” field in the Projucer, and I’m adding them all. But when I build the project for various architectures in Android Studio I get linker errors of wrong architectures. Is there a way to solve this?

Thanks in advance.

BTW
Thanks a lot JUCE team!!! for the SharedResourcePointer, it saved my life while I was using the nasty jni (It is a real PITA). That class is almost black magic to me lol.

Hey.

One way you can achieve this is to organise your libs into directories named after supported ABIs and have your libs organised as:

lib/armeabi/foo.lib
lib/armeabi-v7a/foo.lib
lib/arm64-v8a/foo.lib
lib/x86/foo.lib
lib/x86_64/foo.lib

then, in Projucer for Debug and Android builds, you setup Extra library search paths as something like (depending on your exact path):
../lib/${ANDROID_ABI}
and in main Android exporter setup you set External libraries to link to
foo

${ANDROID_ABI} variable will make sure that correct directory is picked depending on your target

2 Likes

Thanks a lot!! It worked