Android Plugin with AAR dependency, Android studio + gradle, external libs w/ resources

Unfortunately if your plugin has dependencies on more than one library that are only distributed as ‘aar’, then there’s a problem. We’ve stumbled upon the same issues while making plugins, and in these cases where there are multiple ‘aar’ files needed for the plugin to work, we’ve had to abandon the project.

However if there’s only one aar it may work.

When you package your plugin do the following:

  1. Rename ‘classes.jar’ in the aar to something useful and copy it to the ‘android’ folder

  2. Copy the ‘res’ folder from the aar and put it in a ‘resources’ folder under ‘android’ (you’ll end up with android/resources/res)

  3. In the resources folder create a file called package.txt

  4. Edit package.txt and enter the name of the package that the resources should be associated with. Like: com.something.somethingelse