0

I have an Mi 9 phone, which has a SnapDragon 855, which as far as I could tell runs ARMv8.

I created a simple C++ NDK project in Android Studio, and tried to link a library compiled for aarch64 which is ARMv8, however it complains because it's trying to compile for ARMv7.

I think ARMv7 can run on ARMv8, but why does it do that? Is it possible to force an ARMv8 compilation? I only have the ARMv8 version of the library.

4
  • Do you want people with phones older than yours to be able to run your app? Commented Jun 21, 2020 at 1:46
  • @JosephSible-ReinstateMonica for now I'd like only to test the .so as I only have it for armv8. Is it possible? Commented Jun 21, 2020 at 1:49
  • It could be trying to compile for both, or the project could be set up for only armv7 for some reason. Without any build files or further information we have no way of helping. Commented Jun 21, 2020 at 2:16
  • Check your build.gradle file. developer.android.com/distribute/best-practices/develop/… Commented Jun 21, 2020 at 2:50

2 Answers 2

1

modify build.gradle like following:

defaultConfig { ndk { abiFilters 'arm64-v8a' } } 
Sign up to request clarification or add additional context in comments.

Comments

1

The solution might be explained at https://developer.android.com/ndk/guides/abis

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.