Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "extra": -2147483648 (Android 6) #143

Open
Halynsky opened this issue Feb 18, 2019 · 5 comments
Open

Error "extra": -2147483648 (Android 6) #143

Halynsky opened this issue Feb 18, 2019 · 5 comments

Comments

@Halynsky
Copy link

Halynsky commented Feb 18, 2019

Hello

I have an issue with
Android API level used for build: 28
Android at device/emulator: 6

JS: NativeScript-Audio - TNSPlayer [audioPath, https://music-player-demo.herokuapp.com/assets/music/track.mp3]
JS: NativeScript-Audio - TNSPlayer [android mediaPlayer is not initialized, creating new instance]
JS: NativeScript-Audio - TNSPlayer [_mAudioFocusGranted, false]
JS: NativeScript-Audio - TNSPlayer [resetting mediaPlayer...]
JS: NativeScript-Audio - TNSPlayer [setting datasource, https://music-player-demo.herokuapp.com/assets/music/track.mp3]
JS: NativeScript-Audio - TNSPlayer [preparing mediaPlayer async...]
JS: NativeScript-Audio - TNSPlayer [errorCallback, 1]
JS: {
JS: "player": {},
JS: "error": 1,
JS: "extra": -2147483648
JS: }

Meanwhile on device/emulator with Android 7+ all works fine.
Android 6 is not supported?

Problem is that I can't debug it further because of very generic error information from plugin.
In docs for Android MediaPlayer I have found that this description
MEDIA_ERROR_SYSTEM (-2147483648) - low-level system error.
But it can be anything.

Please explain to me how I can debug or find a real reason for this case.
Or maybe it is some bug of plugin?

@Halynsky Halynsky changed the title Andriod Error "extra": -2147483648 Error "extra": -2147483648 (Android 6) Feb 18, 2019
@bradmartin
Copy link
Collaborator

bradmartin commented Feb 18, 2019

Hey @Halynsky - I've never debugged the low level android media errors myself.

It could be something with the plugin, maybe bad configuration, but honestly I'm not sure. The error codes leave much to be desired sometimes. Let me know if you find anything and I'd be happy to help or take a look when I find some time.

This SO Post has some decent info on the generic error.

@Halynsky
Copy link
Author

Hi @bradmartin, thx for response.
I have tried one real device and emulator both with Android 6. And I have got the same result in these cases. So maybe Android 6 is just not supported in the latest nativescript-audio. In this case, it is sad because a lot of people still use old Android distributives.
Maybe the reason can be that I build an app with the latest version of Android API 9.0 API Level 28

@bradmartin
Copy link
Collaborator

The audio plugin is using the Android media player so I don't think the plugin itself would cause anything low level to go wrong. It's always possible, like you said, maybe something wrong in a specific Android SDK that your app is built with. Hard to say unfortunately.

@joey0xx
Copy link

joey0xx commented Apr 3, 2019

Im having the same issue with an mp3 file hosted in an azure blob storage on an emulator with Android 9.0.0 and a device with Android 8.0.0.

@pabloacastillo
Copy link

I had this problem, solved it adding an attribute to the <application> tag in AndroidManifest.xml

android:usesCleartextTraffic="true"

And i have audio streaming on again.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants