<eof> expected near 'end'

#1

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.

0 Likes

#2

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

0 Likes

#3

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.

0 Likes

#4

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

This is really confusing me…

0 Likes

#5

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!

0 Likes

#6

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?

0 Likes

#7

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.

0 Likes

#8

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

0 Likes

#9

@asvegren 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.

0 Likes

#10

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

#11

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/

0 Likes

#12

@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!

0 Likes

#13

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!

0 Likes

#14

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

#15

Can you create a minimal repro case for this please?

0 Likes

#16

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)

0 Likes

#17

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

0 Likes

#18

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

#19

That’s great to know!

0 Likes

#20

Thanks! Great!

0 Likes