FileNotFoundException Android logcat errors

后端 未结 3 1728
名媛妹妹
名媛妹妹 2020-12-22 07:15

My game runs correctly when I test the desktop version, but when I launch an android emulator and and try to run the game on the emulator the game closes and I get the logca

相关标签:
3条回答
  • 2020-12-22 07:44

    You should take a look here and follow these instructions : https://github.com/libgdx/libgdx/wiki/Manual-project-setup#asset-folder-setup

    The Android project has a subfolder named assets, which is created automatically. Files available to the Android application must be placed here. This is problematic, because these same files must be available to the desktop application. Rather than maintain two copies of all the files, the desktop project should be configured to find the assets in the Android project [...]

    0 讨论(0)
  • 2020-12-22 07:46

    Make sure you are putting your image in the correct place. Drag your image into the assets folder, then there should be a default data folder, drag your image into the data folder. Next in your code

    Texture playButtonTxture = new Texture(Gdx.files.internal("playButton2.png"));

    should now be

    Texture playButtonTxture = new Texture(Gdx.files.internal("data/playButton2.png"));

    which is just pointing to the location of the image.

    0 讨论(0)
  • 2020-12-22 07:49

    resources going to look for the asset folder, some from there if not inside any folder you want as picture 1,

    enter image description here

    and if within a folder picture 2 and so if in more folders without using the path absolute!

    enter image description here

    Edit:by the way your picture is a picture, good I mean that you can open with another program, not that this fence be corrupt

    enter image description here Your mistake is that in the draft you have android as yourpicture.png is a windows shortcut or link to the photo, delete, and copy photo no link, if you do be sure to press the dragging I think windows control was also to copy

    0 讨论(0)
提交回复
热议问题