Do we need to do anything in particular with them? I assumed they could just be dropped into the project’s “libs” folder, but when I try that in my project I get:
module ‘plugin.openssl’ not found:resource (plugin.openssl.lu) does not exist in archive
no field package.preload[‘plugin.openssl’]
no file ‘(null)/plugin.openssl.lua’
no file ‘(null)/plugin.openssl.lua’
no file ‘/data/app-lib/com.mycompany.myapp-1/libplugin.openssl.so’
no file ‘./plugin.openssl.so’
no file ‘(null)/plugin.openssl.so’
no file ‘/data/app-lib/com.mycompany.myapp-1/libplugin.so’
no file ‘./plugin.so’
no file ‘(null)/plugin.so’
stack traceback:
[C]: in function ‘require’
?: in function ‘require’
?: in main chunk
The only time I’ve used the plugins in Enterprise was when I was making one, so I had the src/plugin/LuaLoader file when building it directly into an app, and then downloaded the plugin from Corona to test using it once it had been compiled.
I’m probably being really simple, but what step have I missed?
with name = “plugin.bit”. The reason is because this is a native library."
Where would this be done? Although we are using Enterprise, we haven’t actually had any need to touch any of the java code yet, mostly we’ve been using it for offline building.
I’m guessing it’s probably in the CoronaApplication.java file, but not 100% certain of that, or where in that file it should go.
And can I check that you did mean “plugin.bit” and not “plugin.openssl”, is the openssl plugin reliant on the bit plugin or was that a typo?
Do we need to do anything in particular with them? I assumed they could just be dropped into the project’s “libs” folder, but when I try that in my project I get:
module ‘plugin.openssl’ not found:resource (plugin.openssl.lu) does not exist in archive
no field package.preload[‘plugin.openssl’]
no file ‘(null)/plugin.openssl.lua’
no file ‘(null)/plugin.openssl.lua’
no file ‘/data/app-lib/com.mycompany.myapp-1/libplugin.openssl.so’
no file ‘./plugin.openssl.so’
no file ‘(null)/plugin.openssl.so’
no file ‘/data/app-lib/com.mycompany.myapp-1/libplugin.so’
no file ‘./plugin.so’
no file ‘(null)/plugin.so’
stack traceback:
[C]: in function ‘require’
?: in function ‘require’
?: in main chunk
The only time I’ve used the plugins in Enterprise was when I was making one, so I had the src/plugin/LuaLoader file when building it directly into an app, and then downloaded the plugin from Corona to test using it once it had been compiled.
I’m probably being really simple, but what step have I missed?
I hate having to bump topics, but I’m still hoping to get some guidance on including libraries into enterprise projects.
Having searched, I’ve found that apparently I include the native plugins like this:
public class CoronaApplication extends android.app.Application { /\*\* Called when your application has started. \*/ @Override public void onCreate() { com.ansca.corona.CoronaEnvironment.addRuntimeListener(new CoronaApplication.CoronaRuntimeEventHandler()); } static { //load library here System.loadLibrary("plugin.openssl"); } private class CoronaRuntimeEventHandler implements com.ansca.corona.CoronaRuntimeListener { //other functions } }
Firstly, is that the correct place to do it, and will I need to do anything else for my require in my lua code to work?
Secondly, how about jar libraries? Do we use System.loadLibrary, or import the package name for each plugin, or something else entirely?
Lastly, what is the process for including plugins on iOS? The “analytics-provider” sample looks like it just includes .h and .mm in its Plugin folder, is that all there is to it?
I’m struggling to find much in the way of documentation for doing this in Enterprise, I presume most Enterprise users are already experienced native android/ios developers, but as a newbie it’s not quite so straightforward.
I’d managed to get it working just as your reply pinged in my inbox, but thank you for confirming that I’ve done it properly. When I posted I hadn’t tested the build with just the loadLibrary for the native libraries, I’d assumed that the jar files would have to be required somehow manually, and then finally decided to comment out all of my “imports” and it worked.
The ios stuff will be handy when I move onto that shortly.
It turned out I didn’t have it 100% fixed, as I also had to add intent-filter/services/etc to the AndroidManifest.xml file, which I mostly have working now.
I have the facebook, flurry, vungle and google play game services plugins working, but I’m struggling to get google IAP working when I build with Enterprise (it works when I build from simuator). When I call store.purchase() nothing happens, I don’t get any errors or any reply at all.
I’m using the plugin.google.iap.v3.jar, and my manifest file has the com.android.vending.BILLING permission and the following:
Is there something else I’m missing? I’m guessing you’ll spot something straight away Danny.
Similarly, I’m not sure how to integrate google play licensing when building with Enterpise. I have the com.android.vending.CHECK_LICENSE permission, and I see there is a google play licensing plugin included with corona enterprise (just called classes.jar), but I’m not sure how I’m supposed to use it.
For the most part we’re using enterprise to do offline building and building multiple apks at once from the command line, so any of the native java stuff isn’t second nature to me yet as we haven’t had to use it.
If anyone can point me in the right direction for these things it would be greatly appreciated.
Have you checked the log to see if any error messages show up there?
The licensing plugin is just like any other plugin, its just named differently. You just have to put it in the libs directory along with the other jar files. After that in your lua code you would call the licensing library like normal.
Is that not necessary? And if it is, where would we put that “key” string when building for enterprise? Or will it still be pulled from config.lua (I know that most stuff in build.settings is ignored when building with enterprise, not sure about config.lua).
with name = “plugin.bit”. The reason is because this is a native library."
Where would this be done? Although we are using Enterprise, we haven’t actually had any need to touch any of the java code yet, mostly we’ve been using it for offline building.
I’m guessing it’s probably in the CoronaApplication.java file, but not 100% certain of that, or where in that file it should go.
And can I check that you did mean “plugin.bit” and not “plugin.openssl”, is the openssl plugin reliant on the bit plugin or was that a typo?
I hate having to bump topics, but I’m still hoping to get some guidance on including libraries into enterprise projects.
Having searched, I’ve found that apparently I include the native plugins like this:
public class CoronaApplication extends android.app.Application { /\*\* Called when your application has started. \*/ @Override public void onCreate() { com.ansca.corona.CoronaEnvironment.addRuntimeListener(new CoronaApplication.CoronaRuntimeEventHandler()); } static { //load library here System.loadLibrary("plugin.openssl"); } private class CoronaRuntimeEventHandler implements com.ansca.corona.CoronaRuntimeListener { //other functions } }
Firstly, is that the correct place to do it, and will I need to do anything else for my require in my lua code to work?
Secondly, how about jar libraries? Do we use System.loadLibrary, or import the package name for each plugin, or something else entirely?
Lastly, what is the process for including plugins on iOS? The “analytics-provider” sample looks like it just includes .h and .mm in its Plugin folder, is that all there is to it?
I’m struggling to find much in the way of documentation for doing this in Enterprise, I presume most Enterprise users are already experienced native android/ios developers, but as a newbie it’s not quite so straightforward.
I’d managed to get it working just as your reply pinged in my inbox, but thank you for confirming that I’ve done it properly. When I posted I hadn’t tested the build with just the loadLibrary for the native libraries, I’d assumed that the jar files would have to be required somehow manually, and then finally decided to comment out all of my “imports” and it worked.
The ios stuff will be handy when I move onto that shortly.