Resources in collection factories are excluded by LiveUpdate (Issue 4713) (SOLVED)

Say I have the following situation:

I have Collection A and Collection B that both use a particular resource (say, a material).

Collection A is loaded through a collection proxy and marked as “Exclude” for LiveUpdate.

Collection B is loaded through a collection factory.

Please correct me if I’m wrong, but for me, expected behaviour is that, since Collection B is referenced by the main collection and can be loaded at any moment, its resources should still be in the main bundle in case the factory is loaded.

Apparently, Defold excludes the common resource from the main bundle and moves it to the LiveUpdate content, so the code spawning Collection B will crash if called before the LiveUpdate content for Collection A is stored.

I made a minimal repro case where it crashes because /builtins/materials/label.materialc gets moved to the live update content: https://github.com/dapetcu21/liveupdate-dynamicfactory-reprocase

UPDATE: I discovered that the issue applies to non-dynamic collection factories as well.

2 Likes

Yeah, this feels like a bug to me as well. Thanks.

1 Like

This happened to me again. This time with a script required by a script attached to a game object in the main collection. I don’t have a workaround for this and we’re releasing on Thursday. Help!

EDIT: I’m trying to move as many resources as possible to a factory that gets loaded after all the live content update is stored. Hopefully this will work.

1 Like

That’s very unfortunate, and we’ll take a look at this tomorrow.
Any extra info/small repro would be very helpful.

The workaround seems to have worked, so there’s not that much time pressure anymore, but:

I have a small repro case for the initial issue (see first post). For today’s issue, it happened with Interrogation at commit aae78efb8. I think you still have access.

The crash I got was:

03-16 17:54:30.102 12300 12331 W defold  : WARNING:RESOURCE: Resource not found: /sound/button.luac
03-16 17:54:30.102 12300 12331 W defold  : WARNING:RESOURCE: Unable to create resource: /main/sound.scriptc
03-16 17:54:30.102 12300 12331 W defold  : WARNING:RESOURCE: Unable to create resource: /main/main_generated_4.goc
03-16 17:54:30.102 12300 12331 E defold  : ERROR:GAMEOBJECT: Could not instantiate game object from prototype /main/main_generated_4.goc.
03-16 17:54:30.104 12300 12331 W defold  : WARNING:RESOURCE: Unable to create resource: /main/main.collectionc

The exact way I repro-ed:

  1. In the repo root, create a .deploy_env file:
return {
  JAVA_HOME = "/Users/da_petcu21/Tools/jdk-11.0.2.jdk/Contents/Home",
  BOB = "/Users/da_petcu21/Tools/bob.jar",
}
  1. Run (requires Lua to be installed)
./deploy.lua_ build android --iap-demo --debug --version-code 1010201 --apkx-main-version 1010201

Amongst other things, this script marks all the collection proxies in main/scene.go as “Excluded” before running bob, so you might be able to reproduce the error with an editor build just by doing that. Another solution to repro without my script would be to run it, wait until it starts running bob, then kill SIGKILL it and it will leave the modifications it does to the project on the file system.

The bob.jar invocation is in deploy/build.lua_ around line 390.

2 Likes

I have found the issue and I’m currently investigating a fix.

4 Likes

@dapetcu21 There is not a new beta build (fdd7d4748a84f30ce6515a1a6ee2e914e1bbf713 from http://d.defold.com/beta/)

Please try it out to see if it fixes the issue for you.

4 Likes

Can confirm that this fixes the issue. Awesome!

4 Likes