Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Experimentation for Engineers: From A/B testing to Bayesian optimization
this week in the
Design
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Android
File not Found problem using LibGDX
Bod MacNeil
Ranch Hand
Posts: 62
2
I like...
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello all. I hope I'm just missing something simple but AS can't find a file thats in my Android assets folder.
Here is the code:
import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class GdxPractice extends ApplicationAdapter { private Texture dropImage; private Texture bucketImage; private Sound dropSound; private Music rainMusic; private OrthographicCamera camera; private SpriteBatch batch; @Override public void create() { // load the images for the droplet and the bucket, 64x64 pixels each dropImage = new Texture(Gdx.files.internal("droplet.png")); bucketImage = new Texture(Gdx.files.internal("bucket.png")); // load the drop sound effect and the rain background "music" dropSound = Gdx.audio.newSound(Gdx.files.internal("water_drop.wav")); rainMusic = Gdx.audio.newMusic(Gdx.files.internal("rain_music.mp3")); //create camera // start the playback of the background music immediately rainMusic.setLooping(true); rainMusic.play(); } }
And below is a pic of the error message and a screenshot of my assets folder to show the picture is there and spelt correctly. any idea?
Bod MacNeil
Ranch Hand
Posts: 62
2
I like...
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Fixed! I never set my working directory to the assets folder folder!
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Help with Libgdx game android audio makes game lag
Media Player Android Sample
Displaying a PNG using JLWGL and Slick
Tricky NullPointerException Problem
How to crop a photo in android?
More...