Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access files in Assets folder from iOS module in Libgdx?

I am trying to get image form assets folder to display it in notification form iOS module. But i could get any solution how to access assets folder from iOS module

  • in android its working just by calling getAssets() but there is no similar function for iOS

I have tried to get image file using Libgdx's following method Gdx.files.internal("/internal-assets/chapter/image.png"); but it is throwing NullPointerException each time

resources are defined in robovm.xml

<resources>
    <resource>
      <directory>assets</directory>
    </resource>
    <resource>
      **<directory>./internal-assets</directory>**
      <includes>
        <include>**</include>
      </includes>
      <skipPngCrush>true</skipPngCrush>
    </resource>
    <resource>
      <directory>data</directory>
    </resource>
  </resources>
like image 370
Amar Maharjan Avatar asked Dec 22 '25 00:12

Amar Maharjan


1 Answers

in robovm.xml change this:

<directory>assets</directory>

to:

<directory>../android/assets</directory>
like image 71
Hadi Ahmadi Avatar answered Dec 23 '25 13:12

Hadi Ahmadi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!