Defold 1.2.175 BETA

I’m afraid I cannot reproduce your scenario.
My output is like this:

DEBUG:SCRIPT: Missing resources,
{ --[[0x11190ead0]]
  1 = "3be32cfd80b4016a9ebaf1c7249396ef608c95bd",
  2 = "9170a12e266ec41f5575bb8f837d0f4bb6cab03f",
  3 = "07f1284d530deb401da0ed142da50d5724cb04cd"
}
INFO:RESOURCE: Live Update archive: /Users/mawe/Library/Application Support/e288e86f371f3dfd7d3f1b207f9d8a3206aa5fb4/liveupdate.arcd
DEBUG:SCRIPT: Successfully stored resource: 07f1284d530deb401da0ed142da50d5724cb04cd
DEBUG:SCRIPT: 
{ --[[0x111910e10]]
  AFTER_STORE = { --[[0x111911020]]
    1 = "3be32cfd80b4016a9ebaf1c7249396ef608c95bd",
    2 = "9170a12e266ec41f5575bb8f837d0f4bb6cab03f"
  }
}
DEBUG:SCRIPT: Successfully stored resource: 3be32cfd80b4016a9ebaf1c7249396ef608c95bd
DEBUG:SCRIPT: 
{ --[[0x111911640]]
  AFTER_STORE = { --[[0x111911850]]
    1 = "9170a12e266ec41f5575bb8f837d0f4bb6cab03f"
  }
}
DEBUG:SCRIPT: Successfully stored resource: 9170a12e266ec41f5575bb8f837d0f4bb6cab03f
DEBUG:SCRIPT: 
{ --[[0x111911e70]]
  AFTER_STORE = { } --[[0x111912080]]
}

And my script looks like this:

function init(self)
	msg.post(".", "acquire_input_focus")
	self.target = "levels#level1"
	self.manifest = resource.get_current_manifest()
end

local function callback_store_resource(self, hexdigest, status)
	if status == true then
		print("Successfully stored resource: " .. hexdigest)

		pprint({ AFTER_STORE = collectionproxy.missing_resources(self.target) })
	else
		print("Failed to store resource: " .. hexdigest)
	end
end

local function load_resources(self, target)
	local resources = collectionproxy.missing_resources(target)
	pprint("Missing resources", resources)
	
	for _, resource_hash in ipairs(resources) do
		local baseurl = "http://192.168.10.210:8000/"
		http.request(baseurl .. resource_hash, "GET", function(self, id, response)
			if response.status == 200 then
				resource.store_resource(self.manifest, response.response, resource_hash, callback_store_resource)
			else
				print("Failed to download resource: " .. resource_hash)
			end
		end)
	end
end

function on_input(self, action_id, action)
	if action_id == hash("touch") and action.pressed then
		load_resources(self, self.target)
	end
end

Perhaps you can give me a small repro case project?

1 Like

Please check your version 1.2.175 and build server https://build-stage.defold.com

3 Likes

Thank you!
I can now reproduce it!

(I must be tired, my test was ofc with the working 1.2.174, which I implemented for reference)

3 Likes

@denis.smirnov.by There is now an updated beta with a fix. Please try it out to see if it works for you.
Thx!

3 Likes

Can this new liveupdate mechanism be used in conjunction with the old one? For Interrogation on Android, for example, we use 2 zip files: A big one that we update rarely and a smaller patch file that we update more often. Can I use a system where the big one is loaded using resource.store_archive() and the individual files from the patch archive are loaded using resource.store_resource()?

Also, can we make store_archive() not move the archive? If the .obb archive is moved from its location, then Google Play will attempt to download it again. If we copy it, we waste space.

It’s not designed to be used in conjunction, no.
The downloaded .zip file will contain all missing content.

I think it’s best you add a feature request for those things.

1 Like

Not sure how the .obb file plays into this? This is the live update content that you choose to download.

We use Live Update to work around the 100MB APK file size limit. We add the Live Update content as .obb files (essentially zip) that Google Play downloads for us as part of the app installation process. The main problem is that the live update content gets duplicated once it’s installed with store_resource() and users are complaining that the game takes twice the space it should on their phones. I was hoping that by feeding the obb file directly to store_archive() we could get around this, but we can’t unless the game reads the obb file in-place without moving it.

1 Like

I think this is the crucial part. What format is it exactly?
The resource.store_archive() currently only supports zip files.
If it’s an Android format, we need to mount it in a different way.
I agree it’s a very good feature, so we should definitely do it if possible.

The moving of a file can ofc be changed, we can store a reference to the actual file elsewhere.

1 Like

It’s not an Android format. It’s whatever format you upload. Google Play doesn’t touch it. We chose to upload zip files.

2 Likes

That’s great!
I wasn’t aware of this, I always though they’d do their own things with the archive (googling it doesn’t make it entirely clear either).

It shouldn’t take long to change the behavior to do what you asked.
I’m currently sitting with another issue though, so I’ll add it in a day or so.

4 Likes

@AGulev I released a new beta now with a fix for Issue 5279. It would be awesome if you could test the functionality on Android of hiding/showing the app many times, e.g. with both an older and newer device.

2 Likes

I’ll test it today evening. Thank you!!!

2 Likes

Any results from your testing @AGulev?

The new beta changed the behavior to not move the file (it just stores a reference to that file) #5323.

Please try it to see if it works for you.
Our planned release is now for tomorrow, unless anything new pops up with this beta.

2 Likes

I thought you saw my message in issue on GitHub https://github.com/defold/defold/issues/5279#issuecomment-724181335

2 Likes

There’s now a (final?) beta out, with some fixes for Android, when it comes to pausing/unpausing the app:


If anyone would like to help test this out, we’d appreciate it.
We hope to release a stable release later today or early tomorrow.

4 Likes

Hi ! When using, I found another error with saving the manifest. I get it when I try to read a fresh manifest after loading and saving it (with reboot).

1 Like

Hi!
Thanks! Would you be able to share your test project with me?

1 Like