[Libgdx]GWT 'not emitting code for accessing method'

I’m using Libgdx to make an HTML app and when I do “gradlew html:superdev” I’ve got a ton of error messages that says “not emitting code for accessing method … either in java.* or GWT related class”.

I have changed in GdxDefinition.gwt.xml the line


<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">

to


<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "file:///‪C:/UserName/Desktop/GWT-module.dtd">

because the default one seems to not work

I use this in my GWT modules, and it works fine for me.


<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
        "http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/core/src/gwt-module.dtd">

Of course this is from the documentation of Wiki, as I don’t use LibGDX. In any case, this should fix it.

SHC, seems that file doesn’t exist anymore, returning a 404

Yes, the docs now recommend not to use the DTD (atleast the folks on IRC said that they aren’t using DTD) but the latest URL is here. The project has now moved to GitHub.

https://raw.githubusercontent.com/gwtproject/gwt/master/distro-source/core/src/gwt-module.dtd

I think that the last link works better but I have one error because I use a “copyOnWriteArrayList” somewhere in the code so it says


No source code is available for type java.util.concurrent.C
opyOnWriteArrayList<E>; did you forget to inherit a required module?

There is no point in using concurrent collections here, since GWT doesn’t support threads.

CopyOnWriteArrayList has perfectly fine usecases in single-threaded code.

But GWT doesn’t provide any concurrent utilities like this in it’s JRE emulation.

http://www.gwtproject.org/doc/latest/RefJreEmulation.html