Audio player in AIR 33.0.2.315

Hello, I have a problem by crashing the AIR music app on Android devices.
On iOS everything works well.
Exported by 33.0.2.315 SDK, latest Animate.
I am using Distriqt ANE for a native media player.

Here are the bugs:
data.naucme.cz/content/files/bug-android-junior_2.mp4
data.naucme.cz/content/files/bug-android-junior_1.mp4

Here is my export dialogue:
data.naucme.cz/content/files/export.png

Here is the actual App:
data.naucme.cz/content/files/junior-and-1-0-2.apk

I am sorry for the foreign language. I try to explain it in a simple way.
Screen 1) “Přihlásit” means login. Just fill in some random name or text, it is all, that’s enough.
Screen 2) There is the main menu, choose “Radio” and then “Pořady” - it means “List of broadcast”. There you can choose any title. Then you can choose PLAY icon, or click in the detail and there is the button “Poslouchej” - it means “LISTEN”.
If you will choose “ŽIVE” on the radio page, you will choose a live MP3 stream (Icecast).

I do not know how to get logs on Android. I didn’t need it before yet.
Is it possible this way? data.naucme.cz/content/files/dialog.png

The problem is for example on Samsung Galaxy8 and LG P20 phones.
On some tablets, it is working well, but I need to release it fast and it is important to have a stable app.
Thank you for your advice.
Pavel V.

PS: using these ANEs, all of them are the actual versions:
com.distriqt.androidsupport.AppCompatV7.ane
com.distriqt.androidsupport.V4.ane
com.distriqt.Core.ane
com.distriqt.MediaPlayer.ane
com.marpies.ane.androidutils.ane

Hi Pavel and welcome to the forum,

with what you describe I’m under the impression you don’t really debug your app in general?

so could you tell first, how do you debug your app usually?
do you use trace() statements? other?

well those could be useful,
it’s not hard, search “Adobe AIR Android logs”
results on this forums
for ex this: Android Local Notification Ane
results on Google
for ex: https://airnativeextensions.github.io/tutorials/device-logs

and the other part, because you seem to have a crash when you play sound,
could you isolate the code sample on how you play the sound ?

Hello, I am sorry for bad post. I solved it today with support from Harman and Distriqt. Please can you delete this thread? It is irrelevant now. And thank you very much for your suggetion how to read the logs the right way! I will try it in the future.

well… I tend to disagree here

if you could take the 5mn to post your original problem
and then the solution/fix to it

it could in the future help someone else

Hi,

The solution was a missing permission that is required for Android 9+ devices to run a foreground service. The MediaPlayer ANE uses a foreground service on Android to be able to play audio while the application is in the background / minimised.

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

Reference

Not including this permission on Android 9+ devices will result in a crash due to the permission denial.

2 Likes

thanks a lot for that :slight_smile:

hopefully it will help someone in the future and avoid that

wisdom_of_the_ancients

3 Likes