0

I am using IntelliJ Idea for the java libgdx development. I have 3 android/desktop modules which shares the same libgdx libraries. Currently i put libgdx libs in all 3 android/desktop modules. But its going to be more than 10 modules. And its a pain process.

So what i did is, created a common android/desktop lib folder in a a root level and added that folder as a lib dependency in each android/desktop module. Desktop compiles and runs fine. But Android app compiles but not running. I am getting this error

"caused by com.badlogic.gdx.utils.GdxRuntimeException couldn't load shared library 'gdx' for target: Linux, 32-bit"

I opened generated apk, it doesnt have the libgdx jar files. Even I tried setting export option for android libs in module settings. But its not working. Check the screenshot

enter image description here

I wanted the idea to export the linked referenced libraries to apk bundle. is there a way?

RameshVel
  • 64,778
  • 30
  • 169
  • 213
  • have you copied the `gdx.jar` into the `libs` folder of your android project? And don't forget the native libraries folder `armeabi` and `armeabi-v7a`. – WarrenFaith Aug 29 '13 at 11:32
  • watch this it might help you http://www.youtube.com/watch?v=pj4wFmAcgVc – Vikalp Jain Aug 30 '13 at 05:01
  • @VikalpJain, thanks man. libgdx project is working fine by traditional configuration. here i want to move lib folders out of each android module to root to have them used in multiple modules. any ideas? – RameshVel Aug 30 '13 at 06:22
  • @RameshVel check this if this works for you http://stackoverflow.com/questions/16698358/gdxruntimeexception-on-android-couldnt-load-shared-library-gdx-for-target – Vikalp Jain Aug 30 '13 at 06:53
  • I haven't tried intellij idea but i think you have set up all the libraries for android and desktop under same project. make them seperate for android and desktop and then try – Vikalp Jain Aug 30 '13 at 06:56

1 Answers1

1

Problem is by default android modulle looks for the reference libraries under the lib folder of the particular module itself. I resolved this by changing Native libs directory from the module lib to the root lib. It works fine now. Attached the screenshot for reference

enter image description here

RameshVel
  • 64,778
  • 30
  • 169
  • 213