1

My build.gradle file builds some native code:

externalNativeBuild {
    ndkBuild {
        path 'src/main/cpp/Android.mk'
    }
}

The problem is that I have tens of build variants, and every time I switch to a different variant the same native code is built again (into a different folder), and this slows down a lot my build time.

What's the best way to build the native code only once and share it between different build flavours?

manfcas
  • 1,933
  • 7
  • 28
  • 47
  • 1
    Check the answer from [Android Studio CMake build once for all build variants](https://stackoverflow.com/a/53861448/8034839) – shizhen Feb 22 '19 at 01:18

0 Answers0