79838548

Date: 2025-12-05 05:03:29
Score: 0.5
Natty:
Report link
  1. Add .aar file into plugin dir:
.
└── my-plugin/
    ├── android/
    │   ├── libs/
    │   │   └── my.aar
    │   ├── src/
    │   └── ..
    └── ...
  1. Update my-plugin/build.gradle
repositories {
    google()
    mavenCentral()
    
    flatDir {
        dirs 'libs' // Add libs directory to the repository
    }
}
dependencies {
    implementation(name: 'my', ext: 'aar') // Add my.aar to the dependencies
}
  1. Update 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.

Reasons:
  • Blacklisted phrase (1): this plugin
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: owl sandy