Libgdx Gwt Module... How to? Errors

Please, im totally new with GWT and Those Gwt-modules… Heres all the information i have , please help! Im reading more tutorials and googling but im not getting what i should do… Should i make a module for each class?


        [ERROR] [com.me.mygdxgame.GwtDefinition] - Errors in 'file:/D:/ArcherProjectLEGACY/my-gdx-game/src/com/me/mygdxgame/MyGdxGame.java'
	[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 24: No source code is available for type br.views.MenuView; did you forget to inherit a required module?
	[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 26: No source code is available for type br.data.SaveData; did you forget to inherit a required module?

Hi guys, the libgdx game loads but then it gives me that error… It shows libgdx loading bar but then that happens.

The my-gdx-game project have this xml :

<?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="com/me/mygdxgame" />
</module>

The Gwt/HTML project have this xml :

<?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>
	<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
	<inherits name='MyGdxGame' />
	<entry-point class='com.me.mygdxgame.client.GwtLauncher' />
	<set-configuration-property name="gdx.assetpath" value="../my-gdx-game-android/assets" />
</module>

The main Class is this :

package com.me.mygdxgame;

import br.views.MenuView;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Screen;

public class MyGdxGame extends Game implements ApplicationListener,Screen {
	@Override
    public void create() {
        //GraphicAvailability.hasGl2Avaiable();
        setScreen(new MenuView());
        
        //SaveData sd = new SaveData();
        //sd.saveDebugData();
    }

    @Override
    public void dispose() {
        super.dispose();
    }

    @Override
    public void render() {
        super.render();
    }

    @Override
    public void resize(int width, int height) {
        super.resize(width, height);
    }

    @Override
    public void pause() {
        super.pause();
    }

    @Override
    public void resume() {
        super.resume();
    }

    @Override
    public void render(float delta) {
      
    }

    @Override
    public void show() {
        
    }

    @Override
    public void hide() {
      
    }
}

What is [icode]br.views.MenuView[/icode] class? I think there are some errors in that.

SHC, thanks for the reply, i still have the same issue, heres the class :

package br.views;

import br.data.LoadData;
import br.data.Options;
import br.dir.DirectoriesMenuView;
import br.views.levels.LevelOne;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.backends.openal.Ogg.Music;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;

/**
 *
 * @author André Vinícius Lopes
 */
public class MenuView implements Screen {

    private Sprite background;
    private SpriteBatch batch;

    private Table table;
    private Stage stage;

    private TextureAtlas buttonSwitcherPack;
    private BitmapFont simpleBlackFont, simpleWhiteFont;
    private Skin skin;
    private TextButton buttonStart;
    private TextButton buttonLoad;
    private TextButton buttonOptions;

    @Override
    public void dispose() {
        background.getTexture().dispose();
        batch.dispose();
        stage.dispose();
        buttonSwitcherPack.dispose();
        simpleBlackFont.dispose();
        simpleWhiteFont.dispose();
        skin.dispose();

    }

    @Override
    public void render(float delta) {
        Gdx.gl.glClearColor(0, 0, 0, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

        batch.begin();
        batch.draw(background, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        batch.end();

        //Table.drawDebug(stage);
        table.debug();
        stage.act(delta);
        stage.draw();
    }

    @Override
    public void resize(int width, int height) {
        stage.setViewport(width, height, true);

        int w = (Gdx.graphics.getWidth() / 2);
        int h = (Gdx.graphics.getHeight() - Gdx.graphics.getHeight() / 5);

        table.setPosition(w, h);

        table.invalidateHierarchy();
        buttonLoad.invalidate();
        buttonStart.invalidate();

    }

    @Override
    public void show() {

        final DirectoriesMenuView directoriesMenuView = new DirectoriesMenuView();

        background = directoriesMenuView.getBackground();
        batch = new SpriteBatch();
        buttonSwitcherPack = new TextureAtlas();
        buttonSwitcherPack.addRegion("buttonNormal", directoriesMenuView.getButtonNormal());
        buttonSwitcherPack.addRegion("buttonPressed", directoriesMenuView.getButtonPressed());
        skin = new Skin(buttonSwitcherPack);
        simpleBlackFont = directoriesMenuView.getSimpleBlackFont();
        simpleWhiteFont = directoriesMenuView.getSimpleWhiteFont();

        //Create Stage
        stage = new Stage();
        //Make the Stage Accept inputs
        Gdx.input.setInputProcessor(stage);

        //Create Table
        table = new Table();

        //Create First Button
        TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
        textButtonStyle.up = skin.getDrawable("buttonNormal");
        textButtonStyle.down = skin.getDrawable("buttonPressed");
        textButtonStyle.font = simpleWhiteFont;
        textButtonStyle.pressedOffsetX = 1;
        textButtonStyle.pressedOffsetY = -1;

        buttonOptions = new TextButton("Options", textButtonStyle);
        buttonOptions.addCaptureListener(new ClickListener() {

            @Override
            public void clicked(InputEvent event, float x, float y) {
                if (Options.isSoundOn()) {
                  
                    Music music = (Music) Gdx.audio.newMusic(directoriesMenuView.getButtonOptionsSound());
                    music.setLooping(false);
                    music.play();
                }

                ((Game) Gdx.app.getApplicationListener()).setScreen(new OptionsView());
                dispose();
            }
        });

        //Add style to Button
        buttonStart = new TextButton("Start", textButtonStyle);
        buttonStart.addCaptureListener(new ClickListener() {

            @Override
            public void clicked(InputEvent event, float x, float y) {
                if (Options.isSoundOn()) {
                    Music music = (Music) Gdx.audio.newMusic((directoriesMenuView.getMenuViewButtonSound()));
                    music.setLooping(false);
                    music.play();
                }
                ((Game) Gdx.app.getApplicationListener()).setScreen(new LevelOne());
                dispose();
            }
        });

        //Create Second Button
        buttonLoad = new TextButton("Load", textButtonStyle);
        buttonLoad.addListener(new ClickListener() {

            @Override
            public void clicked(InputEvent event, float x, float y) {
                if (Options.isSoundOn()) {
                    Music music = (Music) Gdx.audio.newMusic(directoriesMenuView.getButtonLoadSound());
                    music.setLooping(false);
                    music.play();
                }
                try {
                    LoadData ld = new LoadData();
                    ld.loadData();
                    dispose();
                } catch (Exception ex) {
                    System.out.println("Error Loading Data" + ex.getMessage());

                }
            }
        });

        //Create Label
        Label label = new Label("Archer Hunter", new Label.LabelStyle(simpleBlackFont, Color.BLACK));

        //Add actors to Table.
        table.add(label);
        table.row();
        table.add(buttonStart);
        table.row();
        table.add(buttonLoad);
        table.row();
        table.add(buttonOptions);

        //Configure Table
        Table.drawDebug(stage);
        table.debug();
        table.setPosition(((float) Gdx.graphics.getWidth() / 2f), ((float) Gdx.graphics.getHeight() - (float) Gdx.graphics.getHeight() / 5f));

        //Add Table To Stage
        stage.addActor(table);
    }

    @Override
    public void hide() {
    }

    @Override
    public void pause() {
    }

    @Override
    public void resume() {
    }

}

GWT needs to know exactly where to get all sources from. Since br.views is not a sub-package of com.me.mygdxgame, it cannot be found. Define that as a source path in your gwt module definition, or move that to the com.me.mygdxgame package. Also, even if it could find the source, it won’t compile because you reference com.badlogic.gdx.backends.openal.Ogg.Music - You should reference com.badlogic.gdx.audio.Music instead.

Yay thanks for the answer m8.

I fixed this :

 Also, even if it could find the source, it won't compile because you reference com.badlogic.gdx.backends.openal.Ogg.Music - You should reference com.badlogic.gdx.audio.Music instead.

Now, about this :

GWT needs to know exactly where to get all sources from. Since br.views is not a sub-package of com.me.mygdxgame, it cannot be found. Define that as a source path in your gwt module definition, or move that to the com.me.mygdxgame package. 

I dont know what to do, heres a screenshot of my eclipse project.

http://imageshack.us/a/img96/6991/rmiv.jpg


Edit :

I did this :

<?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>
	<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
	<inherits name='MyGdxGame' />
	 <inherits name="br.views"/>
	  <inherits name="br.dir"/>
	<entry-point class='com.me.mygdxgame.client.GwtLauncher' />
	<set-configuration-property name="gdx.assetpath" value="../my-gdx-game-android/assets" />
</module>

And got this…

[quote] [ERROR] Unable to find ‘br/views.gwt.xml’ on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[/quote]

Alright, i did a little thing to help sort stuff out…

http://img17.imageshack.us/img17/7598/3y8c.jpg

It loads the game, but when i click starts, it locks down and dont start the game.

It just loads the first View Class.It does make the sound but nothing else happens.

Ah, also, this shows up in eclipse :

http://www.java-gaming.org/?action=pastebin&id=755

Some kind of Error it seems.

I’m not sure of this, so I can’t do any much help. Sorry.

Maybe it is easier to create a new project and copy/paste your code in there.

Thats what i did, i put all the code in the same package in setup UI.

IDK whats happening.

When i press Load it says it doesnt find one of the images… weird.

Try refreshing every project in Eclipse. I think this should solve your problem.

Still nothing. I updated all libraries.
When i do, it stop working, so i change this in XML :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

Exactly , this is what i do :
add this line :

And it loads, but still gives that error.