Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Use abiFilter in product flavour definitions to filter for the suppor…
Browse files Browse the repository at this point in the history
…ted architectures

This fixes a regression from #294

That patch adds a dependency which loads some native libraries. Those native libs are
shipped for a variety of architectures. Specifically, there are versions of aarch64 and armv7.
What seems to happen is that since those libraries are loaded first (GV is lazily initialized
after history stuff), and since aarch64 versions of these libs is chosen by the native loader,
consequent native loads select for the same abi type. aarch64 version of libmozglue isn't there,
loader fails to find it and we crash.

Being explicit with the abiFilter in the product flavour definitions strips out aarch64 app-services
libs from the apk. When they're loaded first, armv7 versions are picked (since we don't have any other
ones), and everything works correctly afterwards.

Another way to achieve the same result would be to exclude arm64 libs via packagignOptions directive:
packagingOptions { exclude "lib/arm64-v8a/**" }

... but that's a less flexible approach in the longer term.
  • Loading branch information
Grisha Kruglov authored and boek committed Jan 30, 2019
1 parent 43986db commit f78b627
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@ android {
flavorDimensions "abi"
productFlavors {
// replace the libraries with 64-bit versions when they're ready
arm { dimension "abi" }
x86 { dimension "abi" }
// Processor architectures
arm {
dimension "abi"
ndk {
abiFilter "armeabi-v7a"
}
}
x86 {
dimension "abi"
ndk {
abiFilter "x86"
}
}
}

compileOptions {
Expand Down

0 comments on commit f78b627

Please sign in to comment.