'How to include c/cpp header files inside aar?
Android .aar usually only contain *.jar, *.so and asset related resources.
How to include *.so related header files inside .aar?
Solution 1:[1]
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"
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
