System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Memory: 100.54 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.0
System Images: android-23 | Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-26 | Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-Q | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.0 => 0.60.0
npmGlobalPackages:
react-native-cli: 2.0.1
"react-native-track-player": "^2.0.0-rc4"
Im upgrading to RN 0.60 and i facing a error in Xcode:
<unknown>:0: error: filename "AudioSession.swift" used twice: '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/SwiftAudio/Classes/AudioSessionController/AudioSession.swift' and '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/SwiftAudio/Classes/AudioSessionController/AudioSession.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
<unknown>:0: error: filename "DSL.swift" used twice: '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Example/Pods/Quick/Sources/Quick/DSL/DSL.swift' and '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Example/Pods/Quick/Sources/Quick/DSL/DSL.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
<unknown>:0: error: filename "NowPlayingInfoCenter.swift" used twice: '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/SwiftAudio/Classes/NowPlayingInfoController/NowPlayingInfoCenter.swift' and '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/SwiftAudio/Classes/NowPlayingInfoController/NowPlayingInfoCenter.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
<unknown>:0: error: filename "NowPlayingInfoController.swift" used twice: '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/SwiftAudio/Classes/NowPlayingInfoController/NowPlayingInfoController.swift' and '/Users/maikmacs/code/react-native/project-APP/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/SwiftAudio/Classes/NowPlayingInfoController/NowPlayingInfoController.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
Try upgrading to 2.0.0-rc10. It seems that the current latest points to rc4 which fails to build and throws error on pod install
npm i [email protected]
or
npm i react-native-track-player@next
@mhabegger , I'm facing with this error:
Unhandled JS Exception: Super expression must either be null or a function
@ithustle Can you post your package.json ?
or
npm i react-native-track-player@next
My issue was fixed updating to "react-native-track-player": "^2.0.0-rc10" , After that i clean the project and reinstall the pods.
@mhabegger , I fixed it changing my ProgressBar component class to a functional component and import useProgress(). Thanks
@ithustle, is it possible show an example?
"react-native": "0.60.4",
"react-native-track-player": "^2.0.0-rc13",
@rochapablo , something like this ...
import TrackPlayer, { useProgress } from 'react-native-track-player';
export const ProgressBarPremium = props => {
const progress = useProgress();
return (
<View { ...props } style={styles.progressContent}>
<Text style={{ color: "#fff", alignSelf: "center" }} >{formatTime(progress.position)}</Text>
<Slider
value={progress.position}
maximumValue={progress.duration}
onValueChange={value => {
TrackPlayer.seekTo(value)
}}
style={{ width: "70%" }}
/>
<Text style={{ color: "#fff", alignSelf: "center" }} >{formatTime(progress.duration)}</Text>
</View>
)
}
Most helpful comment
@rochapablo , something like this ...