Can I use Symlinks?

Hi,

I am using symlinks (Symbolic Links) for the first time (trying to make my code more reusable etc) and it works great on the simulator, but when I compile to Android I get an error, see below.  Are symlinks OK,  am I missing something?

OS Mac: 10.13.4

Corona: 3253

Android: S7 (7.0)

 ERROR: Runtime error /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:906: module 'scripts.helper.gameNetworking' not found: no field package.preload['scripts.helper.gameNetworking'] no file '/data/user/0/com.riceburgerlabs.braindistraction/files/coronaResources/scripts/helper/gameNetworking.lua' no file '/data/app/com.riceburgerlabs.braindistraction-1/lib/arm/libscripts/helper/gameNetworking.so' no file './scripts/helper/gameNetworking.so' no file '(null)/scripts/helper/gameNetworking.so' no file '/data/app/com.riceburgerlabs.braindistraction-1/lib/arm/libscripts.so' no file './scripts.so' no file '(null)/scripts.so' no file '/data/app/com.riceburgerlabs.braindistraction-1/lib/arm/libscripts.helper.gameNetworking.so' no file './scripts.helper.gameNetworking.so' no file '(null)/scripts.helper.gameNetworking.so' stack traceback: [C]: ? [C]: in function 'require' /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:906: in function 'require' main:185: in function 'func' /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:203: in function \</Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:190\>

Cheers,

Craig

Update.

It appears to be an issue with symlinks and Corona Live Builds.  If I untick this option then it runs perfectly OK, but if I have live builds ticked then it errors.  Has anyone got symlinks working with Live Builds?

On a separate note, hard links work perfectly OK, but these are limited to files, not folders.

Craig

Unfortunately there’re limitation on how symlinks can be used with live builds. Only local symlinks are supported.

Thanks Vlads, What is meant by “local” symlinks? All my files are on the same drive. Cheers

I know you’re a OS X user, but for future readers, let me add a Windows 7 and 10  specific answer.

To me a local link is one to a file on a drive in the same machine.  Remote links are to networked drives.

Local symlinks work fine for general development.

They also work fine for the first build of a live build.

That said, making changes to files in a symlinked folder will not be noticed by live builds or the simulator launch-on-change feature.   However, a manual relaunch or forced rebuild picks up the changes.  

Here is an example of how you make a folder symlink in Windows:

mklink /j .\ssk2 X:\Work\00\_CurentProjects\Corona\SSK2\ssk2

Within a project, actually. I know it isn’t most useful option, but symlinks cause lots of problems when syncing, especially if you sync from different machines to same build.

Update.

It appears to be an issue with symlinks and Corona Live Builds.  If I untick this option then it runs perfectly OK, but if I have live builds ticked then it errors.  Has anyone got symlinks working with Live Builds?

On a separate note, hard links work perfectly OK, but these are limited to files, not folders.

Craig

Unfortunately there’re limitation on how symlinks can be used with live builds. Only local symlinks are supported.

Thanks Vlads, What is meant by “local” symlinks? All my files are on the same drive. Cheers

I know you’re a OS X user, but for future readers, let me add a Windows 7 and 10  specific answer.

To me a local link is one to a file on a drive in the same machine.  Remote links are to networked drives.

Local symlinks work fine for general development.

They also work fine for the first build of a live build.

That said, making changes to files in a symlinked folder will not be noticed by live builds or the simulator launch-on-change feature.   However, a manual relaunch or forced rebuild picks up the changes.  

Here is an example of how you make a folder symlink in Windows:

mklink /j .\ssk2 X:\Work\00\_CurentProjects\Corona\SSK2\ssk2

Within a project, actually. I know it isn’t most useful option, but symlinks cause lots of problems when syncing, especially if you sync from different machines to same build.