I’m currently building a plugin using Enterprise.
Originally when I was coding it I put the jar files for the client’s APIs into the projects libs folder. This works fine when building the app directly, but now that I want to build the plugin itself to submit to Corona I’ve hit a snag.
I noticed that when sunning the build.plugin.sh script, the libs folder gets cleaned, so I’ve added my 2 jar files to this section:
\<macrodef name="copy-libs"\> \<sequential\> \<mkdir dir="libs" /\> \<copy file="JNLua.jar" todir="libs" /\>
<copy file=“Corona.jar” todir=“libs” />
<copy file=“mySDK1.jar” todir=“libs” />
<copy file=“mySDK2.jar” todir=“libs” />
</sequential>
</macrodef>
(I’ve trimmed the path names down to make them more readable here, in my actual code they do look inside the correct Corona Enterprise directory).
Ignoring all of the other Corona/Lua/Java imports, this is how the start of my myLuaLoader currently looks, with imports referencing the external jar files:
package plugin.myLibrary; import com.clientCompany.myLibrary.myservice.\*; import com.clientCompany.myLibrary.myservice2.\*;
However once I build the plugin, all of the imports for the classes in those jar files do not work any more.
Do I need to change the import class names? Or have I missed something else? I assumed that I could just remove the 2 SDK jars that I was using and replace them with the new plugin jar, but maybe I need to do something else?
Edit:
Just to make it easier to solve, the error message that I get when I start up the app is:
java.lang.RuntimeException: java.lang.NoClassDefFoundError: plugin.myLibrary.LuaLoader$mySDKClass
with the stack trace going right back to require(“plugin.myLibrary”) in main.lua (“mySDKClass” implements a class that is imported from the client’s SDK).