Please Help! My game works on [DEBUG] android builds, but fails on [RELEASE] builds for Android

Please help me figure this out as I have been at it for days trying to find out a reason for this failure.

In editor, my game works fine.. When testing the game on my android device I would use [DEBUG] variant of the bundling process and even then the game would work fine and I would get any error/message logged via adb.

Finally ready for release, when I build a [RELEASE] variant of the bundle and deploy it on device, something in my game breaks, its either my camera.script, or my game_manager.script or tower.script.

The game bundles and launches fine, but something is not working ONLY in release mode, and since I cant get any log output via adb, I cant figure out whats going on?

I tried Write Log == true in the game.project setting, but the log.txt generated at /sdcard/Android/data/com.farazkhandev.pixelcommander/files/log.txt is empty.

what are my options, where can I even begin to search for a solution?

Thanks..

The most common case is converting a hash into a string. Hashes are just numbers, and strings for them exist only in debug, for debugging purposes.

3 Likes

Yes, I’m ready to bet big that this is the case. Do not rely on the result of a tostring() being the same on a value of type hash in release and debug mode.

1 Like

There are quite a few places where I am relying on tostring and converting hash values to string. I’ll have a look and report back.

Thanks :slight_smile:

Would only converting hash values to string be problematic? Because I have changed the code where I am converting has values to string and the making decisions in game based on the string value.

But would the below also be problematic?:

local my_path = tostring(msg.url("#").path)

I am using path values of units and then making string comparison below. Would this tostring also be a problem in release builds?

Yes, url contains 3 hash values, you can’t use them as strings

1 Like