question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App music continues to play (with choppy audio) in iOS 13.2, 13.3, and 13.5 simulators when app is put into background

See original GitHub issue

I don’t currently have a real iOS device to test on, so I haven’t yet confirmed whether this affects real devices as well. If anyone reading this issue is able to test, I’d appreciate the confirmation.

Issue details

When running a libgdx app in the iOS 13.3 simulator: If the app has music playing and you swipe the app to the background, the music unexpectedly continues to play and sounds very choppy. This problem exists for brand new, minimally-configured libgdx apps. Please see the “Reproduction steps/code” section for more info.

I’m using Eclipse with the RoboVM plugin to run the app, and this error message appears when the app is sent to the background:

2020-05-14 11:46:37.815 IOSLauncher[91140:2360202] Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

And then when you bring it to the foreground and send it to the background again:

2020-05-14 11:47:09.100 IOSLauncher[91140:2360202] Can't end BackgroundTask: no background task exists with identifier 4 (0x4), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

This background music behavior didn’t exist in the past (e.g. testing on iOS 11.3). Normally, putting the app in the background silenced any playing music.

Reproduction steps/code

  • Create new app using latest gdx-setup.jar (as of this writing, 2020-05-14)
  • Import into Eclipse
  • Install version 2.3.9 of the RoboVM plugin for Eclipse (because it seems that you can’t build/run for the iOS 13 simulator with earlier releases)
  • Add an mp3 file called “music.mp3” at android/assets/music.mp3
  • Update the create() method in core/src/com/mygdx/game/MyGdxGame.java (or wherever your app entry point is – the class that extends ApplicationAdapter) so it looks like this:
public void create () {
		batch = new SpriteBatch();
		img = new Texture("badlogic.jpg");
		music = Gdx.audio.newMusic(Gdx.files.internal("music.mp3"));
		music.setLooping(true);
		music.play();
	}
  • Run the game via RoboVM Eclipse plugin Run Configuration, selecting project my-gdx-game-ios, device type iPhone 11 ..., 13.3 and arch 64-bit (x86_64).

One thing to note, for the above instructions, is that the current gdx-setup.jar creates an app with a top level build.gradle robovm version of 2.3.8. You can leave that version as is or update to 2.3.9, but it doesn’t change the problem I’m describing. Both cases build for the iOS 13 simulator as long as your RoboVM Eclipse plugin is 2.3.9.

Version of LibGDX and/or relevant dependencies

Tested with:

  • libgdx 1.9.8 and 1.9.10
  • RoboVM 2.3.9 Eclipse plugin
  • Gradle RoboVM version of 2.3.8 or 2.3.9 (but Eclipse plugin must be 2.3.9)
  • iOS Simulator - iPhone 11 with iOS 13.2 or 13.3
  • Xcode 11.3.1

Stacktrace

No relevant stacktrace.

Please select the affected platforms

  • Android
  • iOS (robovm)
  • iOS (MOE)
  • HTML/GWT
  • Windows
  • Linux
  • MacOS

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
elohanloncommented, Aug 27, 2020

@MrStahlfelge Yes, I’ll close now.

1reaction
obigucommented, May 16, 2020

If you want to follow up on the issue it is you who should run those tests 😃

  1. Test again on Eclipse and RoboVM 2.3.9 to confirm the issue is linked plugin version.
  2. Try on IntelliJ both 2.3.10-SNAPSHOT and 2.3.9 on Simulator. This way you’ll cover all combinations of IDE and platforms and we can further investigate if it’s a RoboVM issue.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Music plays in the background even when app is not running!!
A music app can "spawn" a play process that will continue playing. It SHOULD kill that process if you remove the app from...
Read more >
Common iOS 13 Problems and How to Fix Them - Digital Trends
Here are the most recent iOS 13 problems and suggested fixes, ... The problem: Performance lag, various app problems, battery drain, ...
Read more >
iOS - Wikipedia
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. ... These mobile apps have collectively been downloaded...
Read more >
How to Enable Full Screen Music Player on iOS 16 Lock Screen
Full-screen music player bypasses the wallpaper and changes the full background of the Lock Screen. · Tapping the album art or the bottom...
Read more >
Some iPhone Users Report Significant Battery Drain Due to ...
Some iPhone Users Report Significant Battery Drain Due to Music App Background Activity in iOS 13.5.1 · Force quit the Music app. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found