Closed spencerlearning closed 7 years ago
Here is the bug report explaining the issue:
The LC standalone builder will typically report an error if you try to use a resources folder. The Levure packager runs the standalone builder under a special testing mode, however, by calling revSetTestEnvironment true
. When running in testing mode this is what happens:
revDoSaveAsStandalone
calls revSaveAsMobileStandalone
which in turn calls revSaveAsMobileStandaloneMain
.revSaveAsMobileStandaloneMain
throws an error if a resources
folder is being added to the mobile app.revSaveAsMobileStandalone
catches the error and displays it using answer
. In testing mode the error is returned.revDoSaveAsStandalone
never checks for errors. In testing mode the error is swallowed up and never reported. That is why Levure didn't report anything.I've pushed a change that runs the packager in normal mode rather than testing mode. The upside is that all errors are reported and you see feedback during the build process. The downside is that you have to press an OK button after each platform is built.
The reason you have to press OK after building for each platform is because the Levure packager builds one platform at a time. I found this approach to be more reliable then trying to build for all platforms at once.
In order to suppress the "Standalone application saved successfully."
message that revSaveAsStandalone
displays after building for a platform a new parameter would need to be added. Currently it can only be suppressed if running in test mode and that means all messages and feedback are suppressed.
I filed an enhancement request to suppress the success message when building standalone.
Alright, now that all of the coding issues have been addressed we have to decided on which folder name to bless for resources. Suggestions? Shall we just go with assets
?
Why not stuffs
? It's stuff
, but it's plural. Assets
is so not-LC.
@macMikey :-)
I'm aiming for something a little more professional.
I think assets
is probably the best choice. It is a synonym for resources
and it is a standard term in web design. I can't think of any other good alternatives.
I was just looking through the code and there is only one place where resources
is used. When loading extensions
using load extension
I was passing in a default with resource path
that pointed to a resources
folder alongside app.yml
. I don't have a use case for doing this and the developer can specify a folder to use for with resource path
in app.yml
so I removed that code.
So perhaps we just need to make a note saying "don't use a folder named resources in the app folder" if you are building for iOS?
I think you should probably go further than that. I think you should pick a name, whether it be "Assets" or "Support", or whatever, and then get the n00bs in the habit of using that name as a convention. In the docs, you can mention that "Resources" is bad because of ios and then leave it at that. When the Levure project is built, add the
@macMikey By "when the Levure project is built" are you referring to the stack that creates new projects?
Yep. I think that that stack should create an "Assets" folder, and then the docs should just matter-of-factly state that's where those support files go. The app.yml file should also call it "Assets". Avoid 90% of the trouble by taking all the "paint inside the lines" "follow the directions" people out of play. Add notes to the docs to take care of just about everyone else, and for those special few, there's RTFM.
Agreed. I'll update the stack that creates a new project.
I just found a problem with not having the packager build standalones in testing mode. When building the standalones I now get errors about stacks in memory that need to be purged.
That leaves us in an interesting position. If we build in testing mode everything runs smoothly but there are some edge case errors that are not reported. If we don't build in testing mode then the IDE loads stacks differently and reports error that break the standalone building process.
Now to determine which problem is easier to fix...
I'm closing this as the issue reported in this bug report has been fixed.
On iOS, you cannot successfully build an application that has a folder named
resources
in the root of theapp
folder.Follow the wiki instructions to create a new project from master.
Create a folder named
resources
in the root of theapp
folder alongsideapp.yml
and put a file in the folder.Add the folder to
copy files
inapp.yml
:In Standalone Application Settings accept defaults except iOS is the only platform selected.
In message box, run
levurePackageApplication "beta"
. It builds much quicker than normal. Look at the contents of the generated iOS bundle. It is empty except for a single file.Now change the folder name to
assets
or any other name, updatecopy files
inapp.yml
, and rebuild. It builds normally and everything is in the iOS bundle as expected.Now create a folder named
resources
inside theassets
folder, add in a file so it isn't empty, and rebuild. Everything works fine.Conclusion: On iOS you cannot have a folder named
resources
in the root ofapp
folder. This issue does not occur with MacOS, Windows, or Android.