libgdx/gdx-liftoff

TeaVm issue

4lfg24 opened this issue · 7 comments

4lfg24 commented

Hi I was trying to use teaVm to run my game in the browser, when I ran the "run" gradle command it opened a page at localhost:8080 (as I suppose it should), but the screen doesn't render anything, I open up the browser's terminal and I get this error: Uncaught ReferenceError: main is not defined at onload ((index):8:96), did I mess something up?

Not an expert with TeaVM but does #120 solve your problem?

Also, do you use any reflection stuff or LibGDX-AI? For reflection you need to manually add the classes to your TeaVM launcher in order to work (like Ashley components) and LibGDX-AI does not work if you use the special annotations. I think in general annotations do not work at the moment.

Anyway, you are better raising your issue at the teavm repository in my opinion.

4lfg24 commented

Unfortunately, I don't think it's a problem related to my project, because after setting up a new barebone project (without modyfing anything) and running the teaVM run task i still get the same error, I got an error in the stack trace that says: | Class: - | Method: - | Text: There's no main class: 'com.alfredo.games.teavm.TeaVMLauncher'
could this be the problem?

I'll try to replicate, but we've since updated gdx-teavm to 1.0.0-b3 and just now to 1.0.0-b4, so the bug might happen only in the latest stable release.

Actually, I can't even replicate in the latest stable release... What browser are you using to view the TeaVM page at localhost:8080 ?

I think the issue was resolved. Refer to teavm repo: xpenatan/gdx-teavm#92

OK, great, I'll close then. Thanks!

4lfg24 commented

I was using chrome btw, I just used @xpenatan's template and it works fine with that