0

Android .aar usually only contain *.jar, *.so and asset related resources.

How to include *.so related header files inside .aar?

MemetGhini
  • 31
  • 5

1 Answers1

0

Try to use AndroidNativeBundle plugin.

  • Edit your root build.gradle file, add classpath 'io.github.howardpang:androidNativeBundle:1.1.1' to the file
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        //Add androidNativeBundle dependency
        classpath "io.github.howardpang:androidNativeBundle:1.1.1"
    }
}
  • Apply plugin to your lib, add following line to your lib build.gradle
plugins {
    id 'com.android.library'
    id 'com.ydq.android.gradle.native-aar.export'
}
  • Specify header path that you want to export, add following code segment to your lib build.gradle;
nativeBundleExport {
    headerDir = "${project.projectDir}/native/export/header/path"
}
MemetGhini
  • 31
  • 5