My Gradle file is building a CMake project that creates two libs, but only one is added to the APK. I know AGP can ‘see’ both the CMake targets and their file paths because they’re both listed in the generated android_gradle_build.json
file:
"renderdoc::@febfabf0ba9bc1c41be4": {
"toolchain": "toolchain",
"abi": "arm64-v8a",
"artifactName": "renderdoc",
"output": "<staging dir>/Debug/<hash>/arm64-v8a/lib/libVkLayer_GLES_RenderDoc.so",
"runtimeFiles": []
},
"renderdoccmd::@e4803fe6fd4d0c030575": {
"toolchain": "toolchain",
"abi": "arm64-v8a",
"artifactName": "renderdoccmd",
"output": "<staging dir>/Debug/<hash>/arm64-v8a/lib/librenderdoccmd.so",
"runtimeFiles": [
"<staging dir>/Debug/<hash>/lib/libVkLayer_GLES_RenderDoc.so"
]
}
And indeed the files are built in the locations listed. But in gradle/build/intermediates/cxx/Debug/<hash>/obj/arm64-v8a
there is only the librenderdoccmd.so
library, and subsequently only that lib ends up in the APK.
How does Gradle/AGP decide which CMake-generated files should be copied into the APK?