Convert from Corona SDK to Native... step by step tutorial needed, or someone who can help me out.

I’m used to developing Corona SDK apps on Windows and need to add a native feature to my Android app.

Thus I’ve installed Android Studio and Corona Native on a Mac and am looking for tutorials on how to convert my Corona SDK based app to Corona Native.

So far 'm not really successful. I found bits and pieces of information, and a lot of the original howto’s from Corona Labs are not accessible anymore (404 errors). 

Is there a step-by-step walkthrough somewhere? Or can someone help me out?

Thanks!

Basically you start an Enterprise project by copying the “App” template to where you want to work. Inside of App is a folder named Corona.  Copy your existing Corona project to that folder.  The build.settings file doesn’t really get used, though in the future for Android we will be loading plugins by reading build.settings and the orientation table gets used (maybe only on iOS).  That said, many of the things in build.settings (the android table in particular) will need to be added to the AndroidManifest.xml file.

Were you might run into a problem is with plugins. In the old “Enterprise” projects, we has a big file you could download that had all the plugins in it (that we make) and you could get the various .jar files from third-party developers in the marketplace. We are working on getting it so that plugins regardless of the creator can be downloaded by reading the build.settings file. This is working on iOS builds but not Android builds. Our engineers are working on bringing that to completion. Let me know what plugins you need and I’ll see if I can find a way to get you the most recent files.

After that, you should just be able to build your app using Android Studio.

Rob

Hello Rob, thanks for your clarification. 

I’ve got a clean install of Android Studio (ran it once for configuration), I ran the “Setup Corona Native”, made a copy of the app template and put the “old” Corona SDK project in the Corona folder. But after opening the project in Android Studio I am stuck. There’s no “clean” or “make” available (they’re greyed out). The Run command does not work either, I can choose “Run…” but that does not get me anywhere since it asks me for “Edit Configurations”.

I tried opening the sample projects but with similar results. 

Is there a sample project that you know it works? Am I forgetting a setting? 

Regards,

~Rob

The change of environment (Win -> Mac) had made me quite a novice again… sorry for asking noob questions…

I have made some progress now, I had to open the project in the Android folder, not its parent folder. 

Right now I still need to have the Enterprise versions of following plugins:

  • OneSignal

  • OpenSSL

  • [Google Play Services] (is that embedded?)

@Rob, could you provide me with the latest builds of those plugins? I can’t seem to download them on the website. (I do not have permission to view the contents of the “Enterprise” tab in the daily builds page).

There are some other stuff I need to find out as well, like where to put the images, icons and notification-bitmaps. But that seems more Android related than Corona…

Thanks in advance,

~Rob

I want to thank the guy from Corona support (a russian bloke, “Bektur” I think his name was) and Rob M. too. This morning I got the Native Android app (my first) working and not a minute too soon. Thanks for your help! 

Just for your information, here’s why I had to convert my Corona SDK app to Native: 

In my original (SDK) app I’m using the OneSignal plugin, to add support for push messaging. My client asked if I could add a custom notification sound. Basically this should be no problem, and for the iOS version it took about 5 minutes to get it working. But for Android the custom audio file had to be placed in the APK’s /res/raw folder. Corona SDK does not support that. Not sure why that is, or why OneSignal dictates the sound file to be at that location, but it is how it is. 

So I first tried repackaging the APK that was created by the Corona Simulator (unpack the APK, add the sound file to the correct folder, repackage, realign and re-sign the APK) but that doesn’t work. Every asset in the APK is accompanied by an index (jar) that is created during build, so if I add a file afterwards, it just isn’t visible from within the app.

So I had to use Native to make this one working… just to be able to put a single file on a certain location in the APK… talk about a waste of time…
Anyway, I had quite a steep learning curve to overcome the last few days, having to work on a Mac (I’m a Windows guy), fiddling with gradle build scripts, adding the required Corona plugins, adding dependencies for those plugins, dealing with the strangest error messages and all that right in the middle of Corona’s transition from Enterprise to Native, which caused many online resources and howto’s to be unavailable (a lot of 404’s).

I now remember why I am so happy with Corona SDK. It’s a safe environment that shields you from having to fiddle with native sh*t. The time to market is so much faster when not having to deal with native hassle, build scripts and cross-platform issues. I’m so spoilt by Corona SDK I found myself being such a noob when I had to go “back” to Java. :slight_smile:

Anyway, thanks again! I hope you guys add some support for adding files to Android’s /res/raw folder in Corona SDK in the future.

Regards,

~Rob

Hi @springmorning - just a quick question, whilst you were having issues getting Corona native to work with Android - did you come across the following error message?

Error:Execution failed for task ':app:certifyBuild'. \> Process 'command '/Users/jon/Library/Application Support/Corona/Native/Corona/mac/bin/CoronaBuilder.app/Contents/MacOS/CoronaBuilder'' finished with non-zero exit value 254

And if so how did you fix it.  Native just worked on IOS but I’m having real issues trying to get it to work on Android.

Thanks 

Jon…

Hi Jon, sorry to disappoint you, but I never encountered this message. 

I think I know what you are going through :slight_smile: good luck!

Basically you start an Enterprise project by copying the “App” template to where you want to work. Inside of App is a folder named Corona.  Copy your existing Corona project to that folder.  The build.settings file doesn’t really get used, though in the future for Android we will be loading plugins by reading build.settings and the orientation table gets used (maybe only on iOS).  That said, many of the things in build.settings (the android table in particular) will need to be added to the AndroidManifest.xml file.

Were you might run into a problem is with plugins. In the old “Enterprise” projects, we has a big file you could download that had all the plugins in it (that we make) and you could get the various .jar files from third-party developers in the marketplace. We are working on getting it so that plugins regardless of the creator can be downloaded by reading the build.settings file. This is working on iOS builds but not Android builds. Our engineers are working on bringing that to completion. Let me know what plugins you need and I’ll see if I can find a way to get you the most recent files.

After that, you should just be able to build your app using Android Studio.

Rob

Hello Rob, thanks for your clarification. 

I’ve got a clean install of Android Studio (ran it once for configuration), I ran the “Setup Corona Native”, made a copy of the app template and put the “old” Corona SDK project in the Corona folder. But after opening the project in Android Studio I am stuck. There’s no “clean” or “make” available (they’re greyed out). The Run command does not work either, I can choose “Run…” but that does not get me anywhere since it asks me for “Edit Configurations”.

I tried opening the sample projects but with similar results. 

Is there a sample project that you know it works? Am I forgetting a setting? 

Regards,

~Rob

The change of environment (Win -> Mac) had made me quite a novice again… sorry for asking noob questions…

I have made some progress now, I had to open the project in the Android folder, not its parent folder. 

Right now I still need to have the Enterprise versions of following plugins:

  • OneSignal

  • OpenSSL

  • [Google Play Services] (is that embedded?)

@Rob, could you provide me with the latest builds of those plugins? I can’t seem to download them on the website. (I do not have permission to view the contents of the “Enterprise” tab in the daily builds page).

There are some other stuff I need to find out as well, like where to put the images, icons and notification-bitmaps. But that seems more Android related than Corona…

Thanks in advance,

~Rob

I want to thank the guy from Corona support (a russian bloke, “Bektur” I think his name was) and Rob M. too. This morning I got the Native Android app (my first) working and not a minute too soon. Thanks for your help! 

Just for your information, here’s why I had to convert my Corona SDK app to Native: 

In my original (SDK) app I’m using the OneSignal plugin, to add support for push messaging. My client asked if I could add a custom notification sound. Basically this should be no problem, and for the iOS version it took about 5 minutes to get it working. But for Android the custom audio file had to be placed in the APK’s /res/raw folder. Corona SDK does not support that. Not sure why that is, or why OneSignal dictates the sound file to be at that location, but it is how it is. 

So I first tried repackaging the APK that was created by the Corona Simulator (unpack the APK, add the sound file to the correct folder, repackage, realign and re-sign the APK) but that doesn’t work. Every asset in the APK is accompanied by an index (jar) that is created during build, so if I add a file afterwards, it just isn’t visible from within the app.

So I had to use Native to make this one working… just to be able to put a single file on a certain location in the APK… talk about a waste of time…
Anyway, I had quite a steep learning curve to overcome the last few days, having to work on a Mac (I’m a Windows guy), fiddling with gradle build scripts, adding the required Corona plugins, adding dependencies for those plugins, dealing with the strangest error messages and all that right in the middle of Corona’s transition from Enterprise to Native, which caused many online resources and howto’s to be unavailable (a lot of 404’s).

I now remember why I am so happy with Corona SDK. It’s a safe environment that shields you from having to fiddle with native sh*t. The time to market is so much faster when not having to deal with native hassle, build scripts and cross-platform issues. I’m so spoilt by Corona SDK I found myself being such a noob when I had to go “back” to Java. :slight_smile:

Anyway, thanks again! I hope you guys add some support for adding files to Android’s /res/raw folder in Corona SDK in the future.

Regards,

~Rob

Hi @springmorning - just a quick question, whilst you were having issues getting Corona native to work with Android - did you come across the following error message?

Error:Execution failed for task ':app:certifyBuild'. \> Process 'command '/Users/jon/Library/Application Support/Corona/Native/Corona/mac/bin/CoronaBuilder.app/Contents/MacOS/CoronaBuilder'' finished with non-zero exit value 254

And if so how did you fix it.  Native just worked on IOS but I’m having real issues trying to get it to work on Android.

Thanks 

Jon…

Hi Jon, sorry to disappoint you, but I never encountered this message. 

I think I know what you are going through :slight_smile: good luck!