Is there document or web page with step by step on upgrading an existing Enterprise project to Native?
The new version supports both old Enterprise style projects and new Native style projects. After installing Corona go to /Applications/Corona/Native.
You will find two programs to run there, one setups up the environment for Enterprise, the other for Native and I believe you can run both. New projects using the “App” template will be “native” based.
For iOS, you can run a build dialog in Xcode to download and install the plugins. See: https://coronalabs.com/blog/2017/07/06/using-plugins-in-corona-native-projects-ios/
We don’t have similar functionality for Android yet. There are multiple complexities. For now the best we can offer is a command line tool (write to support AT coronalabs.com if you need it) that will download them and then you have to hand copy them to your project and in some cases manually integrate them with Gradle. Hopefully we will have a documented path to doing this at some point in the near future.
Thanks for this. I’m having some trouble with this.
I have an Enterprise project I haven’t compiled in perhaps a year. My Enterprise subscription expired last spring, and I was told I did not need to renew as Native was now free.
I installed the 2017.3135 release, and ran the “Enterprise” setup app as you suggest.
FIrst problem: I use Flurry and Bit Enterprise plugins. I could not access Enterprise plugins as the Corona web site said I don’t have an Enterprise license. I copied older plugins from a previous build, but don’t know how that will work out, nor where to find updated copies of what I need.
After cleaning up some issues such as missing Games, Photo and libSTDC++ vs libC++ overrides, etc, the app compiled, but failed to build with:
Could not launch Corona Builder. Your current subscription ‘Corona SDK’ does not have sufficient privileges.
ERROR: This computer is not properly authorized. You must have an account with the Enterprise (Native extensions) subscription. Please use the ‘authorize’ command or check that your subscription type is valid.
Using Bundle Id: (com.kinnor.xxx)
Using AppId: (com.kinnor.xxx)
Creating application.metadata …
Archiving /Users/tbuchler/Library/Developer/Xcode/DerivedData/TropeTrainer-akvmzbrcxxxtqedhaltopcazfhyr/Build/Products/Debug-iphonesimulator/xxx.app/*.lu into /Users/tbuchler/Library/Developer/Xcode/DerivedData/xxx-akvmzbrcxxxtqedhaltopcazfhyr/Build/Products/Debug-iphonesimulator/TropeTrainer.app/resource.car
ERROR: Failed to generate resource.car.
Exiting due to errors (above)
Command /bin/sh failed with exit code 255
What do I need to do to get this to build, and where do I find the latest Enterprise plugins for Flurry and Bit (bitwise arithmetic)?
Thanks,
-Tom
Hi,
- To download plugins follow these tutorials:
iOS - https://coronalabs.com/blog/2017/07/06/using-plugins-in-corona-native-projects-ios/
Android - https://coronalabs.com/blog/2017/10/19/using-plugins-with-native-android-builds/
- Go to Simulator preferences and press “Deauthoirze and Quit” button. After that you will have to log in again and will be able to build Native project.
-
In tthe Active Scheme button specified in the instructions to download the plugins does not have a “Download Plugins” entry in its dropdown menu.
-
I closed XCode, Deauthorized and Quit the SDK, reopened and relogged in successfully. Reopened XCode and project. I get the same authorization error I reported above.
-
New question: Once 1 and 2 work, what do I do to purchase deactivation of the Corona Splash Screen for this Enterprise project?
-Tom
-
Look into our iOS Native Template located in Corona/Native/Project template/ios folder. You will find how Download Plugins scheme is implemented.
-
Try to execute
~/Library/Application\ Support/Corona/Native/Corona/mac/bin/CoronaBuilder.app/Contents/MacOS/CoronaBuilder deauthorize email password
and then
~/Library/Application\ Support/Corona/Native/Corona/mac/bin/CoronaBuilder.app/Contents/MacOS/CoronaBuilder authorize email password
- You have to purchase Splash Screen Control plugin https://marketplace.coronalabs.com/plugin/splash-screen-control
-
In Corona/Native/Project template/ there is no ios folder, only an App folder. In Corona/Native/Project template/App/ios I don’t know what to look for.
-
I deauthorized and authorized via Terminal. I get the same error when building.
-
Thank you.
What’s the next thing to try. I’ve got an app that is crashing on iPhone X, so I am beginning to get concerned that something is wrong with my project or environment that simple normal things are not working as documented.
-Tom
I would recommend you to start a brand new Native project. Copy your Corona folder and any native code files, libraries and frameworks and start with that fresh model.
It must be much easier than adapt your current project to new structure.
If you want to migrate your existing project from old Enterprise structure to new Native style projects, easiest way would be to copy a template app, and copy in your enterprise sources and only necessary application specific settings. This sounds tedious, but rather simple process.
Another alternative is try to copy settings from App template to your project. This would include:
-
Select + in Targets window for your project, in Cross-Platform select Aggregate, name it Download Plugins.
-
In Build Phases for Download Plugins target create New Run Script Phase, and copy over download plugins phase over from template app.
-
Copy CoronaNative.xcconfig and CoronaApp.xcconfig files. In Targets select your app, and select CoronaApp and CoronaNative as in template project, do same for any plugin projects if you have any. Here’s a screenshot of how it should look like (and where to look for it):
https://i.imgur.com/Y1Yib4W.png
-
Copy over build settings from the template app in your app targets. You can switch to basic view, to see which settings was changed. Make sure you have same C++ compiler and library. Note that if setting is different, but one project have it in bold and other in regular thin font, this means that setting is inherited from either config file or project.
-
Go thorough script build phases for your app target, compare with template.
This should be it… Alternatively, if you just looking to reuse plugins, you can try running script which downloads plugins manually, or create dummy project, copy of template App with only build.settings entries to download your plugins, and manually copy them over (check out NativeApp.xcconfig to see downloaded plugin locations and settings)
Thanks guys! I’ve started with the Native Template, and copied my stuff in. I’m working out the little details.
Builds are succeeding, however I’m getting runtime error: Could not load provider (flurry) due to the following reason: modlule ‘CoronaProvider.analytics.flurry’ not found: resource (CoronaProvider.analytics.flurry.lu) does not exist in archive…
I put into build.settings
plugins =
{
[“plugin.bit”] =
{
publisherId = “com.coronalabs”
},
[“plugin.flurry.analytics”] =
{
publisherId = “com.coronalabs”
},
},
and ran Download Plugins. I find the plugins in my Library/APplication Support/Corona/Native Plugins folder.
There is a reference to them in CoronaApp.xconfig in their proper places.
There used to be a reference to these plugins in Frameworks and in Build Phases: Link Binary with Frameworks, but I don’t see them in the new Native structure.
What am I missing?
-Tom
Currently CoronaApp.xcconfig should get generated lines to link with target plugins for iOS. Like, something like -lFlurryPlugin -lFlurry, which is exact equivalent of adding those libraries to linked frameworks section in xcode. Make sure they are reflected in your app’s target in build settings in linker settings.
It did add the -lFlurry etc to CoronaApp.xconfig.
In the simulator, the app showed a splash screen then failed with an exception that it could not find one of a dozen ways it was looking for flurry:
ERROR: Runtime error
ERROR: Could not load provider (flurry) due to the following reason: module ‘CoronaProvider.analytics.flurry’ not found:resource (CoronaProvider.analytics.flurry.lu) does not exist in archive
no field package.preload[‘CoronaProvider.analytics.flurry’]
no file '/Users/tbuchler/Library/Developer/CoreSimulator/Devices/CA28BBB7-3CC1-40F4-B319-8FE19875A1BC/data/Containers/Bundle/Application/2B238D98-2AF6-4786-B118-5B453489E50F/TropeTrainer.app/corona-plugins/CoronaProvider/analytics/flurry.lua’
no file '/Users/tbuchler/Library/Developer/CoreSimulator/Devices/CA28BBB7-3CC1-40F4-B319-8FE19875A1BC/data/Containers/Bundle/Application/2B238D98-2AF6-4786-B118-5B453489E50F/TropeTrainer.app/CoronaProvider/analytics/flurry.lua’
no file '/Users/tbuchler/Library/Developer/CoreSimulator/Devices/CA28BBB7-3CC1-40F4-B319-8FE19875A1BC/data/Containers/Bundle/Application/2B238D98-2AF6-4786-B118-5B453489E50F/TropeTrainer.app/CoronaProvider/analytics/flurry.lua’
no file '/Users/tbuchler/Library/Developer/Cor
etc.
Ah. I believe you’re included old Flurry plugin. One you included is https://docs.coronalabs.com/plugin/flurry-analytics/index.html, which is used as require( “plugin.flurry.analytics” ).
Corona provider one is “CoronaProvider.analytics.flurry” with same provider name.
tl;dr: try following and run “Download Plugins” again
plugins =
{
[“plugin.bit”] =
{
publisherId = “com.coronalabs”
},
[" CoronaProvider.analytics.flurry"] =
{
publisherId = “com.coronalabs”
},
},
Thanks, Vlads. I switched to plugin.flurry.analytics, fixed the Init syntax in my code, and all is well in that front.
I think I’m seeing one remaining issue: I’ve purchased the SplashScreen plugin, verified that is Activated, and put into build.settings:
splashScreen =
{
enable = false
},
yet the Corona Splash screen still appears for a couple of seconds. Suggestions?
-Tom
For native, try just unchecking _CoronaSplashScreen.png file from your app Target Membership in Xcode.
I removed the reference to _CoronaSplashScreen.png from my native app in Xcode. I get the error:
Application Validation Error
Incorrect splash screen - the splash screen built into the app is not the one that shipped with buid 2017.3175 of Corona.
Activate the Corona Splash Screen Control plugin in the Marketplace if you want to customize it.
Problem is, I’ve already purchased the Corona Splash Screen Control plugin, and added
splashScreen =
{
enable = false
},
to build.settings.
-Tom
In native builds, splash screen is not affected by build.settings ( CoronaSplashControl#coronanative ). What one has to do is just remove file from distribution.
Here’s a suggestion: try copying Native/Project Template/App to new location, open App/ios/App.xcodeproj, uncheck splash screen target membership as shown on screen shot and press Play button to start an app.
Vlad, I did what you suggested, unchecking the target membership. I additionally ran the “Download plugins” build. The product builds for simulator, and immediately after starting and repeatedly, produces the saalert I reported before:
Application Validation Error
Incorrect splash screen - the splash screen built into the app is not the one that shipped with buid 2017.3175 of Corona.
Activate the Corona Splash Screen Control plugin in the Marketplace if you want to customize it.
How does the app or my development system know that I’ve purchased the Splash Screen plugin?
Could there be a problem with my being registered to have activated this plugin (it shows up as “Activated” in the marketplace web page)
-Tom.
Your account tbuchler@kinnor.com has a valid Splash Screen Control license.
I would recommend to repeat these steps again:
I closed XCode, Deauthorized and Quit the SDK, reopened and relogged in successfully. Reopened XCode and project. I get the same authorization error I reported above.
Maybe restart Mac completely.
I closed XCode, Deauthorized and quite the Corona SDK, restarted the Mac, restarted Corona SDK, reauthorized. Opened project in the SDK and confirmed that it started without splash screen.
I started XCode and opened, then built and ran the project in the XCode Simulator.
I continue to get the above-reported _Incorrect Splash Screen _error.
Suggestions how I can escalate this? I’m about to release a fix that prevents my app from crashing on iPhone X and am running out of time.
-Tom