react-native-track-player: BUG!! Not giving Audio Output on Physical Device after Generating Release Apk
This is not giving audio output on Real physical device but works fine in Emulator.
Main File …
TrackPlayer.setupPlayer().then(async () => {
// Adds a track to the queue
await TrackPlayer.add({
id: '11',
// url: 'http://example.com/avaritia.mp3', // Load media from the network
url: require('./../../AppAssets/songstest/AR.mp3'), // Load media from the app bundle
title: 'Humpi',
artist: 'AR',
album: 'Carnival of Carvings',
genre: 'Melody',
date: '2018-01-20T07:00:00+00:00', // RFC 3339
artwork: require('./../../AppAssets/images/xyz.jpg'), // Load artwork from the app bundle
});
…
onPressPlay = () => {
TrackPlayer.play();
}
… index.js
AppRegistry.registerComponent('MyProject', () => AppNavigator);
AppRegistry.registerHeadlessTask('TrackPlayer', () => require('./player-handler.js'));
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 36 (1 by maintainers)
same issue here, with android but with an streaming url, app works fine on debug mode, but on release after init the TrackSetup, app crashes
Sorry for taking too long to look into this.
In release mode, RN used to copy all resources to the
drawabledirectory, and this module used to look up the files there. It became a problem when RN started to copy non-image files into therawdirectory.Hi, when problem will be solved? There is a way to work around the problem? It is works in dev version of package? Because on 1.0.0 I have this problem (With React Native 0.57.5)
@dcvz were there any commits changing the behaviour? Non-image resources are packaged as raw. Although if you want to bundle a lot of audio in APK itself, you might have more issues with the fact that APK can only be 100 mb large, and you need to use expansion files and generate paths for content provider for example.
Is this still an issue?
It would be helpful if you cud give a push to the solution
@Guichaguri update please
@Guichaguri It is not working and giving expected output.