» »

Android libGdx problem(Error)

Android libGdx problem(Error)

Xpie ::

Imam problem, ko hočem svojo kodo zagnat mi eclipse vrže napako. Možno je da je v kodi1 ali pa v koda2 kej narobe. Problem zgleda takole:

Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/jnigen/NativeCodeGenerator
at com.badlogic.gdx.utils.GdxBuild.main(GdxBuild.java:34)
Caused by: java.lang.ClassNotFoundException: com.badlogic.gdx.jnigen.NativeCodeGenerator
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more


package com.me.mygdxgame;

import java.io.IOException;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;

public class MyGdxGame implements ApplicationListener {
	SpriteBatch batch; //Uporablal bomo da bomo lahko prikazal na backgroundu
	Texture mario; //Uporaba texture
	Player player;
	Vector2 postion;// spreminjanje textur torej resolucij
	InputProcessor inputProcessor;

	@Override
	public void create() {		
		
		batch = new SpriteBatch();
		
	
		
		mario = new Texture(Gdx.files.internal("mario.png")); //povemo kje se nahaja naša textura		
		postion = new Vector2(Gdx.graphics.getWidth() / 2,Gdx.graphics.getHeight() / 2); // za spreminjanje vrednosti x in y	
		
		if(Gdx.files.local("player.dat").exists()){ // to je to
			try {
				player = Player.readPlayer();
			} catch (ClassNotFoundException e) {				
				e.printStackTrace();
			} catch (IOException ex) {				
			ex.printStackTrace();
			}
			System.out.println("Player Exsists, Reading file");
		}
		
	           else{
				player = new Player( new Vector2( Gdx.graphics.getWidth() / 2,Gdx.graphics.getHeight() / 2),"mario.png");
				try {
					Player.SavePlayer(player);
				} catch (IOException ex) {
					
					ex.printStackTrace();
				}
				System.out.println("Player Does not Exsists, Creating Player and Saving Player");
			}
		
		
			
		inputProcessor = new InputProcessor(){

			@Override
			public boolean keyDown(int keycode) {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public boolean keyUp(int keycode) {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public boolean keyTyped(char character) {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public boolean touchDown(int screenX, int screenY, int pointer,
					int button) {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public boolean touchUp(int screenX, int screenY, int pointer,
					int button) {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public boolean touchDragged(int screenX, int screenY, int pointer) {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public boolean mouseMoved(int screenX, int screenY) {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public boolean scrolled(int amount) {
				// TODO Auto-generated method stub
				return false;
			}
			
		};
		
	}

	@Override
	public void dispose() {
		
	}

	@Override
	public void render() {	//metoda za prikazovanje na zaslonu	
		Gdx.gl.glClearColor(1, 1, 1, 1); // spreminjanje barve 
		Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
		
		player.update();
	
		
		
		
		if(Gdx.input.isTouched()){ //Preverimo če je smo se je dotaknili
			System.out.println("Applicatoin clicked"); // izpišemo če smo se je dotaknili
		}
		
//		if(Gdx.input.getAccelerometerX()){
//			
//		}
		
		System.out.println("Mouse x:" + Gdx.input.getX() + " Mouse y:" + Gdx.input.getY());
		
		batch.begin();
		batch.draw(player.getTexture(), player.getPosition().x, player.getPosition().y);
		batch.end();
	}
	@Override
	public void resize(int width, int height) {
	}

	@Override
	public void pause() {
	}

	@Override
	public void resume() {
	}
}

spletne-novice.si
  • spremenil: Xpie ()

Xpie ::

Noben ne ve kako to popravt? :|
spletne-novice.si

nightrage ::

Kaj ti pove ta napaka: java.lang.NoClassDefFoundError: com/badlogic/gdx/jnigen/NativeCodeGenerator
V knjižnicah, ki jih imaš includane v projekt, class NativeCodeGenerator ne obstaja.


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

Android zamenjava pogledov

Oddelek: Programiranje
61086 (907) c00L3r
»

android črta

Oddelek: Programiranje
412412 (1683) g333kk
»

[android] vstavljanje slike

Oddelek: Programiranje
71247 (1144) messi
»

[android] crash

Oddelek: Programiranje
61345 (1154) messi

Pomoč pri Domači nalogi

Oddelek: Programiranje
334581 (3429) Gandalfar

Več podobnih tem