Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Corona Native not compiling Lua files
Started by _Pavel Aug 02 2018 02:53 PM

8 replies to this topic
corona native android studio mac os
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

_Pavel

[GLOBAL: userInfoPane.html]
_Pavel
  • Observer

  • 5 posts
  • Corona SDK

Hello everybody. I'm trying to start with Corona Native and Android Studio.

I followed the instructions for Mac OS from here https://docs.coronalabs.com/native/android/index.html 

 

Everything is working fine, I'm able to build and start the template project on my device, BUT

when I change main.lua located at Corona folder, it's ignored. It seems that it's not used in the project at all.

It's showing default template copied from  /Applications/Corona/Native/ , the project is building with no errors.

However Corona Simulator is showing the changes I made.

What am I doing wrong?



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,714 posts
  • Corona Staff

What version of Corona are you using?

Have you run the "Corona Native" script to setup all the necessary symlinks?

 

Rob



[TOPIC: post.html]
#3

_Pavel

[GLOBAL: userInfoPane.html]
_Pavel
  • Observer

  • 5 posts
  • Corona SDK

Hi Rob, thank you for your reply.

I am using Version: 3.0.0, Build: 2018.3326.

Yes, I have run the script and received the following message: 

 

Setup Corona Native
Created symbolic link:
... /Library/Application Support/Corona/Native
Corona Native is ready


[TOPIC: post.html]
#4

Bektur

[GLOBAL: userInfoPane.html]
Bektur
  • Contributor

  • 135 posts
  • Corona Staff

Make sure you change main.lua in the proper folder. I mean when you build Corona Native project lua files should be placed along with Java code. Like 

 
├── android/
│   ├── app/
│   ├── build.gradle
│   ├── settings.gradle
│   └── etc...
├── Corona/
│   ├── build.settings
│   └── main.lua
│   └── etc...


[TOPIC: post.html]
#5

_Pavel

[GLOBAL: userInfoPane.html]
_Pavel
  • Observer

  • 5 posts
  • Corona SDK

I did it exactly like that. Here is the link to the project:https://drive.google.com/file/d/1Cnq7mZNRRNHrBKwU9a_azSc2ZlKR9CZD/view?usp=sharing



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,714 posts
  • Corona Staff

You will need to grant access to this file before anyone can look at it.

 

Rob



[TOPIC: post.html]
#7

_Pavel

[GLOBAL: userInfoPane.html]
_Pavel
  • Observer

  • 5 posts
  • Corona SDK

Sorry, I've updated the link.



[TOPIC: post.html]
#8

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,714 posts
  • Corona Staff

I opened your project in Android Studio and clicked on the Play button. The app started on my Google Nexus 9 tablet. The display.newText() emitted "Hello World!" as expected.

I opened the main.lua using Sublime Text 3 and changed the display.newText() to "Hello World! How are you?". I stopped the app in android studio and hit play again. I see  "ello World! How are you" on the screen. Of course, the text is cut off because it's too big and is expected. But the main.lua did update.

 

I did disable the Instant Run because it didn't like me having two accounts on the Nexus 9.

 

So for me, it's working.

 

Rob



[TOPIC: post.html]
#9

_Pavel

[GLOBAL: userInfoPane.html]
_Pavel
  • Observer

  • 5 posts
  • Corona SDK

That's strange... It seems that something is wrong with my environment, however I followed the instructions. Even if I rename or delete Corona folder from the project, nothing happens - it starts the same default template.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: corona native, android studio, mac os