0
\$\begingroup\$

I used the libGDX setup UI to create a new project, copied sources from my tablet project and fixed all the errors due to libGDX version changes. Finally at the point to test and run, but first I hate the setup UI for libGDX . It's broken horribly as necessary folders were not created as they used to be, or were not properly imported by Android Studio. Regardless, when I run the desktop launcher the first file it attempts to load causes a file not found crash:

    skin = new Skin(Gdx.files.internal("/data/defaultSkin.json"));

The JSON, Atlas, and PNG files are all in android/assets/data folder. Desktop launcher config is using that folder for the working path as is the ONLY thing I've found online to look at for Android Studio and this particular issue. However I still get the file not found error. And I am using the default skin that I pulled off GitHub. Funny that all this code worked fine on my tablet and Eclipse, however Android Studio is being a broken POS, and this is the "preferred" IDE for development? I had less problems with Eclipse and AIDE (for mobile) except that AIDE pushes libGDX for game development but doesn't fully support the Gradle build that libGDX pushes for uses to utilize rather than downloading the simple to use zip folder with the libs in it. Why the hell fix what isn't broken? It almost always breaks what was perfectly fine.....

\$\endgroup\$
  • \$\begingroup\$ Sorry, what's your question? \$\endgroup\$ – Alexandre Vaillancourt Sep 27 '16 at 14:11
  • \$\begingroup\$ Seriously? As the title suggests I'm having issues with Android Studio desktop project created by the libgdx set up application reading from the assets folder in the Android project likewise created at the same time during the libgdx setup process new grading system that libgdx wants you to use seems to be broken. so aside from scrapping gradle and goong back to the old setup method using zip files what other suggestions can anyone think of if the desktop app is using the android assets folder as working directory already. note: multiple assets folders is a flat out no \$\endgroup\$ – MercifulNinja Sep 27 '16 at 15:45
  • \$\begingroup\$ Try using IntelliJ IDEA instead of Android Studio. Android Studio is a customized version of IntelliJ that is focused on Android but the vast majority of functionality is available in both programs. Follow the project setup process closely and you should be good to go. I've created at least a dozen games using IntelliJ, LibGDX, and the Gradle build system and can assure you that its not broken. \$\endgroup\$ – Lando System Sep 27 '16 at 19:47
1
\$\begingroup\$

You have to set the working folder in the Run Configurations.

Go to Run => Run Configurations.. => choose DesktopLauncher, Arguments Tab => Working Directory => Others then browse to yourproject-android/assets/ and click Apply => Run

enter image description here

\$\endgroup\$
1
\$\begingroup\$

Did you make sure to set the file path to ".../android/assets/" in the configuration settings? Your error message is exact same as one I had and I remember that was my problem anyway

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.