<eof> expected near 'end'

Hi, there!

I am trying to make an Android build for testing my game and I got the error in the subject… The strange thing is that the game runs fine when I launch it from the editor. Moreover the error, appearing twice, is referring to two lua scripts that have not been changed in months!

I have no idea how to fix this. Any help is highly appreciated!

Ciao, Rocco.

Double check the Lua files with errors, most likely the error message is true and you have unmatched opening and closing keywords.

I will double check again… But how is it possible? It runs fine and no error shows up when I launch it from the editor. I don’t understand…

Moreover, the file hasn’t been changed lately and the previous builds went smooth.

I removed some commented lines with --[[ lines ]]-- and the error was fixed in one of the two files.

This is really confusing me…

Also for the other file I removed some commented lines and everything went fine.

I would suggest that the team at Defold investigate this; it looks too strange to me!

It seems that the editor and the builder are using two different lua interpreters. (Sorry for my loose language).

Thanks!

The bundle step uses bob.jar, which (due to legacy reasons) compile all source files in your project. Could it be that you’re not actually using these files, thus it never shows up when doing a build and run in the editor?

Thank you Mathias for your answer. But, no, the files are used in the project.

Morever, the builds went smooth till some weeks ago and deleting a block of commented lines fixed the problem with both files.

I know you have found the solution already, but I had a similar issue a while back relating to nested block quotes: Nested block quotes - errors in Linux builds only

@Alex_8BitSkull thank you! Yes, it looks quite similar: I had line comment(s) inside block comments. But I was making an Android build on a Mac.

Things are getting very serious about this issue with block comments!!!

I ran the build on mobile and the background in the title screen was missing. This never happened before. I removed the block comments in the script controlling the background and also this issue was fixed!

How can I be sure that something else is not working in the right way for some block comments? What should I do? Remove all block comments in my project?

I would bet that this started with version 1.2.161 or 162 or 163.

Could you please advice me?

Many, many thanks!

2 Likes

I think you need to share a minimal example of where this is happening so that we can investigate. Also provide additional relevant information: https://defold.com/manuals/getting-help/

@britzl You are right, my apologize for the poor informations.

I am using Defold 1.2.163 on a Mac running Catalina (10.15). And this is the first time I tried to make an Android bundle with Catalina. Could it perhaps be a problem with bob.jar and Catalina?

For the minimal example. I will try to prepare one but at the moment I cannot anymore reproduce it in my (full) code…

Many thanks!

I don’t think so. Maybe.

Ok, if you’re unable to reproduce it then that’s great (I guess). If it happens again please share a repro case with us and we’ll look into it!

I had same issues and same workaround as deleting all --]]-- and ----[[ lines in (any filename.script added to collection).
for example when building in Editor - all fine, when building web-version, the script with these lines looks like it doesn’t exist. started from 1.2.163 version.

1 Like

Can you create a minimal repro case for this please?

sure, created based on menu_and_game
and this lines broke the project if build HTML5 version. windows. 1.2.163 version. (in 1.2.162 all fine)

Thanks. While this is annoying I believe it is pretty rare for this to happen. We will not do anything about this for now.

Previous to 1.2.163 (1.2.162 and lower worked) we had some multiline Lua comments like

--[[
]]--

and they worked fine when building for Android. With 1.2.163, they no longer work (they made code break in strange ways without reporting errors other than returning module functions as nil). Changing them to

--[[
--]]

fixes the issue.

The editor also supports comment/uncomment of multiple selected lines with Ctrl+/

4 Likes

That’s great to know!

Thanks! Great!