Creating a plugin - Where to put the libraries?

I would like to use C-code with LUA.
Therefore I’d like to build a plugin, which shall contain the library (built from the C-code) and a wrapper function as described in the Solar2D documentation.

I’ve built the library “libplugin.myLibrary.so” with Android Studio, which builds it for 4 architectures. The result are 4 libraries in a fixed directory structure like this:

  • data
    • arm64
      • libplugin.myLibrary.so
    • armeabi-v7a
      • libplugin.myLibrary.so
    • x86
      • libplugin.myLibrary.so
    • x86_64
      • libplugin.myLibrary.so

This directory structure is then packed into one data.tgz.

Where in the plugin do I have to put the data.tgz or the distinct libraries, so that the Solar2D build process puts them into the right place?

I assume you’d like to keep the files on the machine, in which case you can add a Solar2DPlugins folder (if you haven’t already). On Windows this would be %appdata%\Solar2DPlugins; on Mac it’s probably something like ~/Library/Application Support/Solar2DPlugins but I’m not sure.

At that point your full path would go something like PATH_TO_PLUGINS/Solar2DPlugins/NAME/PLUGIN_NAME/android/data.tgz, where NAME would be “com.whatever” (the publisherId from build.settings) and PLUGIN_NAME would be “plugin.whatever”.

Also, I don’t know Android Studio well, but you can probably write a script to tar up and move the results post-build to that directory. Otherwise it might grow a bit tiresome copying it all the time. :slight_smile: