简体   繁体   中英

How do I create an AAR in Android Studio with Prefab exports?

I have an Android project for a library (using the com.android.library plugin), that includes C++ code.When I run the assemble task in gradle, the outputted AAR contains the native library in the /jni folder. However, there is no "prefab" folder. The only documentation I can find about creating Android libraries is here: https://developer.android.com/studio/projects/android-library

The bottom section suggests that the /prefab folder should be there.

I can find information on how to set up a project to import prefabs from an AAR, but I can't find any information on how to build an AAR with prefab exports. Is there a way to set up an Android project with gradle to do this? Are there settings I have to add to specify which native libraries should be exposed?

I'm using Android Studio 4.1.1, gradle 6.8, and Android gradle plugin 4.1.1.

This is covered by the samples. Not sure where it is in the docs, they definitely used to be on DAC. https://github.com/android/ndk-samples/tree/main/prefab/prefab-publishing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM