简体   繁体   中英

Gdx.audio error

So i'm doing the simple game thing in the libgdx wiki and i have finished them and i get these error.

First is this :

dropSound = new Gdx.audio.newSound(Gdx.files.internal("drop.wav"));

rainMusic = new Gdx.audio.newMusic(Gdx.files.internal("rain.mp3"));

i get the error in Gdx.audio

And the second is this

Iterator<Rectangle> iter = raindrops.iterator();

the error is in Iterator

That's what i see in the console

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.Error: Unresolved compilation problems: 
Gdx.audio cannot be resolved to a type
Gdx.audio cannot be resolved to a type

at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: java.lang.Error: Unresolved compilation problems: 
Gdx.audio cannot be resolved to a type
Gdx.audio cannot be resolved to a type

at com.JohnAilamakis.Drop.Drop.create(Drop.java:55)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

Please if you can tell me whhat's the problem.

To resolve this error, reference gdx.jar in the project where ApplicationListener cannot be resolved. Sometimes it's also a problem with Eclipse and deleting and re-importing the project can help to solve the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM