jeudi 14 juin 2018

Libgdx ClassReflection.newInstance don't work with hmtl version

I'm working on an application that must work on desktop, android and web browser.

On Desktop and Android I have no problem, everything work fine. But on the HTML version, the newinstance of a class won't work. I don't understand why.

Here is my code:

public static Node newInstanceGdx(Class<? extends Node> nodeModel) throws ReflectionException {
    if (nodeModel != null)
        try {
            return ClassReflection.newInstance(nodeModel);
        } catch (Exception e) {
            e.printStackTrace();
            Gdx.app.setLogLevel(Application.LOG_DEBUG);

            Gdx.app.log("Reflection", "Can't initialize Node class :  " + (Node.class).getName());
        }
    return null
}

And here is myGame.gwt.xml code :

<?xml version="1.0" encoding="UTF-8"?>
<!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">
<module>
    <source path="fr/EU/Game" />
    <extend-configuration-property name="gdx.reflect.include" value="com.me.reflected.ReflectedClass" />
    <extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.utils.reflect.ClassReflection"/>
    <extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.utils.reflect.ReflectionException"/>

</module>

It always return "null" for the html version, but on the other version, everything work.

Thanks in advance for your help.





Aucun commentaire:

Enregistrer un commentaire