trevordevore / levure

Application development framework for LiveCode
MIT License
32 stars 14 forks source link

Packager not setting android standalone stackFiles correctly #37

Closed spencerlearning closed 7 years ago

spencerlearning commented 7 years ago

The packager for android is not setting the stackFiles property of the standalone correctly, so it fails to load the application.

For testing purposes, I added this handler to the stack script of standalone.livecode:

on openStack
  if the environment is "development" then pass openStack
  answer "stackFiles:" && the stackFiles of me
end openStack

When run on my Android tablet, the answer dialog says:

stackFiles: levureFramework,../levure/framework/levure.livecodescript

When I build and run the same standalone for MacOS and Windows, the answer dialog says:

stackFiles: levureFramework,levure.livecodescript

I haven't run this on ios, but since ios loads the application the stackFiles must be set correctly there as well. So only Android appears to have this problem.

trevordevore commented 7 years ago

@spencerlearning Can you try pulling the latest from tad-mobile-packager and seeing if it makes a difference? I reworked a number of things in order to add simulator support. Let's see if it makes a difference.

Note that you can now pass "iOS simulator" (tested) and "android simulator" (not tested) to levurePackageApplication and the simulator should open.

levurePackageApplication "ios simulator"

I also had to make some changes to the copy files section. all platforms was copying files to the root folder the app was being packaged in (the files would sit alongside the macos, windows, and iOS folders), not copying files into each platform build. Now all platforms does copy all files into each platform build.

I added a package folder section which does what all platforms used to do. I'm looking for name suggestions for this key.

trevordevore commented 7 years ago

@spencerlearning BTW, I rebased tkd-mobile-packager off of master to incorporate your PR which meant I had to force push. Just delete tad-mobile-packager from your computer and download a fresh copy.

spencerlearning commented 7 years ago

I updated to the current master and packager and it is still not running the starter app on android. I tried it on ios and it successfully runs the starter app on my iPad, but oddly enough it is showing the levure/framework path in the stackFiles, the same as Android.

Here is a summary:

Platform stackFiles in standalone openStack Runs app
MacOS levureFramework,levure.livecodescript Yes
Windows levureFramework,levure.livecodescript Yes
iOS levureFramework,../levure/framework/levure.livecodescript Yes (!)
Android levureFramework,../levure/framework/levure.livecodescript No

Hmmm.

trevordevore commented 7 years ago

I know what is going on. The LiveCode mobile standalone builder doesn't pick up and move behavior files associated with the the standalone stack. It looks like the packager will need to manually adjust the stackfiles.

spencerlearning commented 7 years ago

Here is a temporary workaround to load the framework and allow app testing on Android. Put this in the stack script of standalone.livecode:

on preOpenStack
  if the environment is "development" then pass preOpenStack

  if the platform is "android" then
    set the stackFiles of me to "levureFramework,levure.livecodescript"
    set the behavior of me to the long id of stack "levureFramework"
    levureInitializeAndRunApplication
  end if
end preOpenStack
trevordevore commented 7 years ago

@spencerlearning Can you try this branch? It explicitly sets the behavior in the startup handler.

https://github.com/trevordevore/levure/tree/tkd-explicilty-load-framework

spencerlearning commented 7 years ago

@trevordevore It fixes the Android problem and works on iOS and MacOS (I haven't tried it with Windows).

trevordevore commented 7 years ago

Thanks for testing. I'll merge this in tomorrow. We can look at removing it if the standalone builder is fixed. I filed a bug report.

trevordevore commented 7 years ago

Fixed in PR #42