.aar file into plugin dir:.
└── my-plugin/
├── android/
│ ├── libs/
│ │ └── my.aar
│ ├── src/
│ └── ..
└── ...
my-plugin/build.gradlerepositories {
google()
mavenCentral()
flatDir {
dirs 'libs' // Add libs directory to the repository
}
}
dependencies {
implementation(name: 'my', ext: 'aar') // Add my.aar to the dependencies
}
package.json{
"files": [
"android/libs/"
]
}
When you use this plugin in your project, you should copy the my.aar file to project/android/app/libs/may.aar. Remember to remind your users to do this.
Note:
If you are using npx cap open android to launch Android Studio and debug the app, remember to modify the app configuratio:
App -> Edit configuration -> Installation Options -> Deploy:
Switch Default APK to APK from app bundle
This is important, in my tests at least, the default mode causes the built debug APK to be missing .so files that might be present in .aar libraries, leading to runtime errors.
And if you are using command like ./gradlew :app:assembleDebug, it works well, I still don't understand why the default run mode in Android Studio misses .so files.