So for now, i can’t ship compressed and encrypted lua sources?
Not with 1.3.5
I will look into a --compress-lua-source
option for the next release (or even revert the whole Lua 5.1.5 bytecode feature).
Thanks:)
I believe in you
Hello Björn,
I don’t know whether this is at all related, but I get an error to do with bytecode, too since updating.
I use your metrics extension and doing so prevents the app from starting on Android now. Logcat shows not error.
Next, I removed the extension and moved the files into the folder structure and logcat now does report something to do with malformed bytecode:
2022-08-17 09:56:09.144 10036-10053/com.test.todo E/defold: ERROR:SCRIPT: metrics/mem.script:0: attempt to call a number value
stack traceback:
metrics/mem.script:0: in main chunk
2022-08-17 09:56:09.144 10036-10053/com.test.todo W/defold: WARNING:RESOURCE: Unable to create resource: /metrics/mem.scriptc: FORMAT_ERROR
2022-08-17 09:56:09.144 10036-10053/com.test.todo E/defold: ERROR:GAMEOBJECT: Error running script: metrics/fps.script: cannot load malformed bytecode
2022-08-17 09:56:09.144 10036-10053/com.test.todo W/defold: WARNING:RESOURCE: Unable to create resource: /metrics/fps.scriptc: FORMAT_ERROR
2022-08-17 09:56:09.154 10036-10053/com.test.todo E/defold: ERROR:GAMEOBJECT: Error running script: metrics/fps.script: cannot load malformed bytecode
2022-08-17 09:56:09.154 10036-10053/com.test.todo W/defold: WARNING:RESOURCE: Unable to create resource: /metrics/fps.scriptc: FORMAT_ERROR
2022-08-17 09:56:09.154 10036-10053/com.test.todo W/defold: WARNING:RESOURCE: Unable to create resource: /metrics/fps.goc: FORMAT_ERROR
2022-08-17 09:56:09.154 10036-10053/com.test.todo E/defold: ERROR:GAMEOBJECT: Could not instantiate game object from prototype /metrics/fps.goc.
Hope this helps.
Thanks. When run through bob I get some interesting output:
1:26 no viable alternative at input '(to be'
line 1:36 mismatched input 'in' expecting {<EOF>, ';', 'break', 'goto', 'do', 'while', 'repeat', 'for', 'function', 'local', 'if', 'return', ':', '::', '.', '(', '[', '{', NAME, NORMALSTRING, CHARSTRING, LONGSTRING}
line 1:18 no viable alternative at input '(self,'
line 1:38 mismatched input ')' expecting {':', '.', ',', '(', '[', '{', '=', NORMALSTRING, CHARSTRING, LONGSTRING}
line 4:0 mismatched input 'end' expecting {':', '.', '(', ')', '[', '{', 'or', 'and', '<', '>', '<=', '>=', '~=', '==', '..', '+', '-', '*', '/', '%', '//', '&', '|', '~', '<<', '>>', '^', NORMALSTRING, CHARSTRING, LONGSTRING}
line 10:23 token recognition error at: '?'
line 14:16 token recognition error at: '!'
line 14:17 token recognition error at: '!'
line 14:18 token recognition error at: '!'
line 59:110 token recognition error at: '?'
line 140:62 token recognition error at: '!'
line 140:63 token recognition error at: '!'
line 205:85 token recognition error at: '?'
line 8:17 no viable alternative at input '(2022-xx-xx xx'
line 8:13 mismatched input '-' expecting {<EOF>, ';', 'break', 'goto', 'do', 'while', 'repeat', 'for', 'function', 'local', 'if', 'return', ':', '::', '.', '(', '[', '{', NAME, NORMALSTRING, CHARSTRING, LONGSTRING}
And
The build failed for the following reasons:
ERROR _version_changelog.lua:3 '=' expected near 'VERSIONS'
ERROR extensions/external/jumper/core/lookuptable.lua:1 ')' expected near ','
ERROR _TEMP_custom_resources_list.lua:1 '=' expected near 'CUSTOM'
Let’s have a look then:
ERROR _version_changelog.lua:3 ‘=’ expected near 'VERSIONS’
Your project contains this file in the root of the project. It is a changelog and does not contain valid Lua source code.
ERROR extensions/external/jumper/core/lookuptable.lua:1 ‘)’ expected near ','
This is what we have at the beginning of this file:
local addNode(self, node, nextNode, ed)
if not self._pathDB[node] then self._pathDB[node] = {} end
self._pathDB[node][ed] = (nextNode == ed and node or nextNode)
end
This is invalid Lua. It should be local function addNode(....
ERROR _TEMP_custom_resources_list.lua:1 ‘=’ expected near 'CUSTOM’
Again, this is a file with the .lua extension but it does not contain Lua code.
If you fix this the project will build.
Pretty weird that this invalid lua code has never been a problem before… Like if this function is never used
Anyway it works fine now, thanks
The difference is that when you bundle your code the build pipeline (incorrectly) processes all Lua files. This was previously not a problem since we didn’t process the Lua code (to bytecode) but now that we do, these kinds of issues are uncovered.
We’re reverting generation of bytecode for HTML5 builds and will release a new version later today.
Which version were you using before? And what kind of device are you testing on?
Hi there,
I always use the most up to date stable version, so the one before was 1.3.4.
I am on a Mac mini M1, updated yesterday to Monterey 12.5.1. The extension didn’t work before the OS update either, stopped working since Defold 1.3.5.
But didn’t you say there was a problem on Android? And by ‘extension’ you mean the defold-metrics repo (https://github.com/britzl/defold-metrics)?
Sorry! You were faster, I just was about to add:
The Android device I tested it on is a very old Samsung Galaxy Tab S from 2014. And yes, I mean the defold-metrics repo.
EDIT: just fired up Android Studio and installed the app on several virtual devices with the latest Android API: no problem on any of them. Sigh, I need a newer test device, it seems.
I think your Samsung Galaxy Tab S is a 32bit device?
Do you build universal APK for both x32 and x64? If so, could you pls try to build x32 only and check if it works.
Course I can - hang on!
@AGulev: Alexey, you are right, 32-bit only works, did an apk only and an apk+aab. Bundling for both 32-bits and 64-bits crashes the app.
Thanks. This gives us something to investigate.
Could you pls share this metrics/mem.script
file with us?
There it is, I thinks you mean the one from the repo I use in the project, don’t you:
mem.script (306 Bytes)
Just to make sure it’s not down to my project, I just downloaded the defold-metrics repo project itself and ran the tests:
same result: 32 bit works, bundling for both 32 and 64 bit crashes the app on my Samsung Galaxy Tab S.