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

Enum cases with associated values cannot be marked potentially unavailable #1186

Closed
DennisdeWitNL opened this issue Jun 10, 2021 · 18 comments
Closed
Labels

Comments

@DennisdeWitNL
Copy link

Dear,

With the introduction with iOS 15 and Xcode 13, I have discovered a bug. I can no longer compile an app for iOS 15. The problem is in react-native-track-player/Vendor/SwiftAudio/Classes/NowPlayingInfoController/NowPlayingInfoProperty/NowPlayingInfoProperty

The problem is with the following code:

`public enum NowPlayingInfoProperty: NowPlayingInfoKeyValue {

/**
 The identifier of the collection the now playing item belongs to.
 The identifier can be an album, artist, playlist, etc.
 */
case collectionIdentifier(String?)

/**
 The available language option groups for the now playing item.
 Value is an array of MPNowPlayingInfoLanguageOptionGroup items. Only one language option in a given group can be played at a time.
 */
case availableLanguageOptions([MPNowPlayingInfoLanguageOptionGroup]?)

/**
 The URL pointing to the now playing item's underlying asset.
 This constant is used by the system UI when video thumbnails or audio waveform visualizations are applicable.
 */
@available(iOS 10.3, *)
case assetUrl(URL?)`

Resulting in: Enum cases with associated values cannot be marked potentially unavailable (@available(iOS 10.3, *))

I use react-native-track-player 1.2.7. Any solutions?

@vangthachdinh
Copy link

I got the same. Any solutions ?

@nikki-cat
Copy link

Also having this issue now

@dcvz dcvz closed this as completed Aug 10, 2021
@MatthieuPeyrot
Copy link

Hi, we have the same issue did you find a solution or a workaround to fix it ?

@DennisdeWitNL
Copy link
Author

Hi, we have the same issue did you find a solution or a workaround to fix it ?

Workaround: change iOS 10.3 to iOS 10. So iOS 10, *

@MatthieuPeyrot
Copy link

Hi, we have the same issue did you find a solution or a workaround to fix it ?

Workaround: change iOS 10.3 to iOS 10. So iOS 10, *

Change where ? ios development target ? in the Podfile ?

@DennisdeWitNL
Copy link
Author

Hi, we have the same issue did you find a solution or a workaround to fix it ?

Workaround: change iOS 10.3 to iOS 10. So iOS 10, *

Change where ? ios development target ? in the Podfile ?

No. Double click both of the errors in Xcode. It will take you to the right file and lines directly.

@MatthieuPeyrot
Copy link

Hi, we have the same issue did you find a solution or a workaround to fix it ?

Workaround: change iOS 10.3 to iOS 10. So iOS 10, *

Change where ? ios development target ? in the Podfile ?

No. Double click both of the errors in Xcode. It will take you to the right file and lines directly.

it's not same it was iOS 11. i put iOS 10, i manage to build but how to make it persistent ? because everyone will encounter that issue ios 15 is out next week , and clicking and change it manually it's not really a good workaround.

@DennisdeWitNL
Copy link
Author

Hi, we have the same issue did you find a solution or a workaround to fix it ?

Workaround: change iOS 10.3 to iOS 10. So iOS 10, *

Change where ? ios development target ? in the Podfile ?

No. Double click both of the errors in Xcode. It will take you to the right file and lines directly.

it's not same it was iOS 11. i put iOS 10, i manage to build but how to make it persistent ? because everyone will encounter that issue ios 15 is out next week , and clicking and change it manually it's not really a good workaround.

Good. Then I can not help you. 😄

@bourgois
Copy link

@dcvz David can you reopen this? This is critical as iOS 15 is going to be released soon... We just got our app refused by Apple during review because of this.

@DennisdeWitNL
Copy link
Author

@dcvz David can you reopen this? This is critical as iOS 15 is going to be released soon... We just got our app refused by Apple during review because of this.

If you change it to iOS 10 as I said, the app should be approved. I have it approved in the App Store AND it works on iOS 15. It is just a .h file that you change and it will stay forever, unless you update React Native Track Player.

@bourgois
Copy link

It won't "stay forever" except if we include in our CI process to change it every time we build... It would be better to correct the source, no?

@DennisdeWitNL
Copy link
Author

It won't "stay forever" except if we include in our CI process to change it every time we build... It would be better to correct the source, no?

I don’t know what you are doing, but I changed the file, archived the project, built it and sent it to the App Store. I don’t need to change it ‘every time’. I agree @dcvz could take a look and rather make a real, permanent fix that is compliant to iOS 15 development rules.

But for now, I would just go this way, so the app will be approved and not crash in iOS 15 next week. ;-))

@dcvz dcvz reopened this Sep 15, 2021
@dcvz
Copy link
Contributor

dcvz commented Sep 15, 2021

Hey folks thanks for pinging this and flagging it as an incorrectly closed issue! I know iOS 15 is coming really soon.

I've reopened the issue and will do my best to take a look tomorrow with the latest Xcode.

@dcvz
Copy link
Contributor

dcvz commented Sep 16, 2021

I just shipped a new version of RNTP v2.1.0 - could ya'll give this a try?

This release drops support for iOS 11, which allows us to remove these tags. RN no longer supports iOS 10 anyway.

@ouabing
Copy link
Contributor

ouabing commented Sep 18, 2021

@dcvz can we also have this in v1 ? We are still using v1 and got build errors using XCode 13. Thank you.

@therealkh
Copy link

having same issue on rntp 2.1.1, Xcode 13. is there any solution of this, folks?

@artem-simutin
Copy link

artem-simutin commented Nov 1, 2021

@DennisdeWitNL thank you 🙏 Switching to IOS 10 in NowPlayingInfoProperty.swift file at 34 and 119 lines helped me.

P.S I also think that issue is only with Xcode 13^

@jspizziri
Copy link
Collaborator

All, this appears to be working in v2. v1 is no longer supported. I'm closing this issue, but if anyone is still having problems on the most recent v2 release let me know and I'll reopen it.

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

No branches or pull requests