Problems trying to use my own plugins.

I have plugins compiled and working for both iOS and Android. They work if I build the plugin from within the project.

I just can’t seem to get it to work outside of the project for a different app.

I copied the .jar and .a into…

/Applications/CoronaEnterprise/Plugins/ios/asdf.a

/Applications/CoronaEnterprise/Plugins/android/bin/asdf.jar

Then build.sh

What steps am I missing?

For native Android builds, you typically copy the JAR file to your Android application project’s “libs” directory.  This is documented by Google here…

   http://developer.android.com/tools/projects/index.html

The other way to do it is to reference an Android library project directory via your “project.properties” file.  This would include all of that library project’s *.jar files (ie: Java libraries) and *.so files (ie: C/C++ libraries).  If you look at our sample projects included with Corona Enterprise, the Corona library is included in this manner.  Including libraries in this manner is documented by Google via the link above as well.

Ok. So I can’t just put the plugin files in one place, then not worry about it?

For Android, you can put the JAR file in a separate location if you want, but that plugin’s directory would have to be set up as an Android library project (which has a very particular directory structure) and your application project’s “project.properties” file would have to reference that directory.  That’s the 2nd option I posted up above.  This is how the Corona library is normally referenced.  This is also how you would normally including libraries such as facebook as well.

In either case, you have to change something in your application project to tell the Android build system to include your JAR file.  There’s no way around that part.

Now, if you are simply trying to test your plugin JAR file and not include it an app that you want to deploy/publish, then it would be simpler to set up your Android plugin project directory as an application project too.  Meaning, that your project directory would be set to build both a JAR file and an APK.  When building an APK, all of your plugin source code under the “src” directory would be automatically included.  Our “CoronaEnterprise/ProjectTemplates/ads-provider” sample shows an example of this.  Notice that it has 2 scripts under that project, where one scripts build the plugin JAR file, and the other script builds an APK.

Ok. Thanks for the clarification.

I got excited when I found the stuff under /Applications/CoronaEnterprise/Plugins/ and figured all plugins go there.

Is that directory just for reference purposes?

The Corona Enterprise “Plugins” directory provides Corona made libraries that enterprise users can opt-in to include in their applications.  This helps keep your applications small by only including the optional feature that you need.  That was the intent.

We’re still finalizing our plugin support, but in the future, we’ll likely change thing so that you have to download the plugins that you want for Corona Enterprise instead of us including all plugins within the Corona Enterprise folder.  That would be a much more sustainable solution.  Especially since we don’t want the Corona Enterprise zip file to become a super huge download in the future when adding more and more plugins.

Thanks Joshua.

I have everything working smoothly now. :slight_smile:

For native Android builds, you typically copy the JAR file to your Android application project’s “libs” directory.  This is documented by Google here…

   http://developer.android.com/tools/projects/index.html

The other way to do it is to reference an Android library project directory via your “project.properties” file.  This would include all of that library project’s *.jar files (ie: Java libraries) and *.so files (ie: C/C++ libraries).  If you look at our sample projects included with Corona Enterprise, the Corona library is included in this manner.  Including libraries in this manner is documented by Google via the link above as well.

Ok. So I can’t just put the plugin files in one place, then not worry about it?

For Android, you can put the JAR file in a separate location if you want, but that plugin’s directory would have to be set up as an Android library project (which has a very particular directory structure) and your application project’s “project.properties” file would have to reference that directory.  That’s the 2nd option I posted up above.  This is how the Corona library is normally referenced.  This is also how you would normally including libraries such as facebook as well.

In either case, you have to change something in your application project to tell the Android build system to include your JAR file.  There’s no way around that part.

Now, if you are simply trying to test your plugin JAR file and not include it an app that you want to deploy/publish, then it would be simpler to set up your Android plugin project directory as an application project too.  Meaning, that your project directory would be set to build both a JAR file and an APK.  When building an APK, all of your plugin source code under the “src” directory would be automatically included.  Our “CoronaEnterprise/ProjectTemplates/ads-provider” sample shows an example of this.  Notice that it has 2 scripts under that project, where one scripts build the plugin JAR file, and the other script builds an APK.

Ok. Thanks for the clarification.

I got excited when I found the stuff under /Applications/CoronaEnterprise/Plugins/ and figured all plugins go there.

Is that directory just for reference purposes?

The Corona Enterprise “Plugins” directory provides Corona made libraries that enterprise users can opt-in to include in their applications.  This helps keep your applications small by only including the optional feature that you need.  That was the intent.

We’re still finalizing our plugin support, but in the future, we’ll likely change thing so that you have to download the plugins that you want for Corona Enterprise instead of us including all plugins within the Corona Enterprise folder.  That would be a much more sustainable solution.  Especially since we don’t want the Corona Enterprise zip file to become a super huge download in the future when adding more and more plugins.

Thanks Joshua.

I have everything working smoothly now. :slight_smile: