I cannot load and play sound files when I tried to run on simulator. Other assets like textures don’t seem to have this problem. I’m using Gdx v1.9.6 and moe Intellij plugin v1.3.0 with 1.3.2 sdk.
I actually wanted to port an existing Libgdx project to iOS. First I created a base Libgdx project with ios-moe. Then I copied the ios-moe directory to the old project and changed the appropriate build gradles and other project files.
When I run the app in the simulator from IntelliJ, I’m getting this in the console and it crashes:
/Users/igloo/Documents/Libgdx/Projects/SampleProjectSansMoe/gradlew moeLaunch -Pmoe.launcher.options=no-build,no-install-on-target,config:Debug -Pmoe.launcher.simulators=84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7
Configuration on demand is an incubating feature.
Using already downloaded SDK: /Users/igloo/.moe/moe-sdk-1.3.2
:ios-moe:moeLaunchart I 3739 199823 /Volumes/SSD/Android/moe-final/aosp/art/runtime/parsed_options.cc:449] setting boot class path to /Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Bundle/Application/9BC97851-08A3-4FF3-AAEB-DD6FBBB2D285/SampleProjectSansMoe.app/application.jar:/Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Bundle/Application/9BC97851-08A3-4FF3-AAEB-DD6FBBB2D285/SampleProjectSansMoe.app
/Volumes/SSD/Android/moe-final/moe/natj/natj/src/main/native/natj/NatJ.cpp:353 DEBUG: Method ‘boolean java.lang.reflect.Method.isDefault()’ is not accessible.
IOSApplication 3 iOS version: 10.2
IOSApplication 3 scale: 2.0
IOSApplication 3 Status bar is visible (height = 20.0)
IOSApplication 3 Total computed bounds are w=640.0 h=1096.0
IOSGraphics 3 Display: ppi=163, density=2.0
IOSApplication 3 created
IOSApplication 3 resumed
IOSApplication 3 Status bar is not visible
IOSApplication 3 Total computed bounds are w=640.0 h=1136.0
IOSApplication 3 Status bar is not visible
IOSApplication 3 Total computed bounds are w=640.0 h=1136.0
Local dir path: /Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Data/Application/121D3AF0-7E32-4C6C-8946-EE4429C90AA8/Library/local/
2017-03-29 14:35:08.540 SampleProjectSansMoe[3739:199823] OAL Error: -[OALAudioTrack preloadUrl:seekTime:]: <OALAudioTrack: 0x7c150fa0: (null)>: Could not load URL file:///Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Bundle/Application/9BC97851-08A3-4FF3-AAEB-DD6FBBB2D285/SampleProjectSansMoe.app/assets/sampleaudio.ogg: The operation couldn’t be completed. (OSStatus error 2003334207.)
com.badlogic.gdx.utils.GdxRuntimeException: Error opening music file at /Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Bundle/Application/9BC97851-08A3-4FF3-AAEB-DD6FBBB2D285/SampleProjectSansMoe.app/assets/sampleaudio.ogg
at com.badlogic.gdx.backends.iosmoe.IOSAudio.newMusic(IOSAudio.java:67)
at com.bluejay.samplesansmoe.MyGdxGame.create(MyGdxGame.java:21)
at com.badlogic.gdx.backends.iosmoe.IOSGraphics.glkViewDrawInRect(IOSGraphics.java:228)
at com.badlogic.gdx.backends.iosmoe.IOSGLKView.drawRect(IOSGLKView.java:76)
at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
at com.bluejay.samplesansmoe.IOSMoeLauncher.main(IOSMoeLauncher.java:22)
art I 3740 200109 /Volumes/SSD/Android/moe-final/aosp/art/runtime/parsed_options.cc:449] setting boot class path to /Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Bundle/Application/9BC97851-08A3-4FF3-AAEB-DD6FBBB2D285/SampleProjectSansMoe.app/application.jar:/Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Bundle/Application/9BC97851-08A3-4FF3-AAEB-DD6FBBB2D285/SampleProjectSansMoe.app
/Volumes/SSD/Android/moe-final/moe/natj/natj/src/main/native/natj/NatJ.cpp:353 DEBUG: Method ‘boolean java.lang.reflect.Method.isDefault()’ is not accessible.
IOSApplication 3 iOS version: 10.2
IOSApplication 3 scale: 2.0
IOSApplication 3 Status bar is visible (height = 20.0)
IOSApplication 3 Total computed bounds are w=640.0 h=1096.0
IOSGraphics 3 Display: ppi=163, density=2.0
BUILD SUCCESSFUL
Total time: 17.433 secs
If you look closely, I also printed the local storage path and it is:
Local dir path: /Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Data/Application/121D3AF0-7E32-4C6C-8946-EE4429C90AA8/Library/local/
But if you see the error statement:
com.badlogic.gdx.utils.GdxRuntimeException: Error opening music file at /Users/igloo/Library/Developer/CoreSimulator/Devices/84A18051-AD5D-44BC-ACA6-C0B3E9EFDFE7/data/Containers/Bundle/Application/9BC97851-08A3-4FF3-AAEB-DD6FBBB2D285/SampleProjectSansMoe.app/assets/sampleaudio.ogg
Both of them has different application IDs. I’m guessing it has something to do with this bug? How should I proceed from here? I tried mp3 and wav files as well, but the same error is thrown.
Edit: Here’s a link to a sample project: https://drive.google.com/open?id=0BxsAgLj5v1EESkhuQ1BCdUgyMVU