doublesymmetry / react-native-track-player

A fully fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!
https://rntp.dev/
Apache License 2.0
3.18k stars 981 forks source link

[IOS] SwiftAudioEx error #2196

Closed witekmikolajczak closed 6 months ago

witekmikolajczak commented 8 months ago

Describe the Bug After installing react-native-track-player and creating dummy.swift and creating a bridge, I get the following error: /ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/QueueManager.swift (in target 'SwiftAudioEx' from project 'Pods')

Steps To Reproduce

Environment Info:

System:
  OS: macOS 12.5
  CPU: (8) arm64 Apple M1
  Memory: 110.52 MB / 8.00 GB
  Shell:
    version: 5.8.1
    path: /bin/zsh
Binaries:
  Node:
    version: 20.7.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.1.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.09.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /Users/witekmikolajczak/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 21.4
      - iOS 15.5
      - macOS 12.3
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9619390
  Xcode:
    version: 13.4.1/13F100
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.21
    path: /opt/homebrew/opt/openjdk@11/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/witekmikolajczak/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.4
    wanted: 0.72.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Solution

dcvz commented 8 months ago

@witekmikolajczak could you post the full error? I think there's more missing

cappe commented 8 months ago

I am seeing the same error with react-native-track-player@4.0.1. I'm very new to React Native so I'm not sure how to help further.

dcvz commented 8 months ago

I am seeing the same error with react-native-track-player@4.0.1. I'm very new to React Native so I'm not sure how to help further.

A full error message would help a lot!

cappe commented 8 months ago

Logs for a command npm run ios: https://pastebin.com/JZ547efQ. Let me know if I can provide something else :)

dcvz commented 8 months ago

Ok looks like the issue is this:

 error: unable to infer complex closure return type; add explicit type to disambiguate
        let result = try synchronizeThrows {
                                           ^
                                             () -> <#Result#> in 

This was also reported in here - like this person I see you're (well the original poster) also 2 versions behind on Xcode. My guess is their Swift syntax parser was not as advanced then and is throwing issues.

dcvz commented 8 months ago

Is updating Xcode versions an option for you?

cappe commented 8 months ago

It is. I'll report back to you when I've upgraded the Xcode.

EDIT: Actually it requires OS upgrade too. I'm currently in rather slow network so it will take a while. I'll report back as soon as I've upgraded everything.

witekmikolajczak commented 8 months ago
** BUILD FAILED **

The following build commands failed:
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/QueuedAudioPlayer.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/QueueManager.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/RemoteCommandController/RemoteCommand.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'SwiftAudioEx' from project 'Pods')
(4 failures)
linhkiubo98 commented 1 week ago
** BUILD FAILED **

The following build commands failed:
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/QueuedAudioPlayer.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/QueueManager.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/RemoteCommandController/RemoteCommand.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'SwiftAudioEx' from project 'Pods')
(4 failures)
** BUILD FAILED **

The following build commands failed:
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/QueuedAudioPlayer.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/QueueManager.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwift normal arm64 ios/Pods/SwiftAudioEx/Sources/SwiftAudioEx/RemoteCommandController/RemoteCommand.swift (in target 'SwiftAudioEx' from project 'Pods')
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'SwiftAudioEx' from project 'Pods')
(4 failures)

Any solution?