I am building a react-native iOS app that uses the JWPlayer iOS SDK v4 with chrome casting enabled.
As per the JWPlayer and Google Cast docs, I have added the Access WiFi Information capability in Xcode and added NSLocalNetworkUsageDescription and NSBluetoothAlwaysUsageDescription to info.plist.
When a run the app from Xcode on my (real) iPhone, everything works perfectly. The Bluetooth access prompt appears when the app is opened and then when the Chrome-cast button is pressed in the JWPlayer, it prompts for network access - the player handler is able to successfully discover and connect to cast devices.
However, when I archive the app in Xcode for testing via the Ad-hoc, Developer or TestFlight distribution methods, neither the Bluetooth or Network Access prompts are triggered and as a result, JWPlayer is unable to discover any cast devices.
I've checked the info.plist file located at /Users/jonathanredford/Library/Developer/Xcode/Archives/2021-09-30/[AppName] 30-9-21, 3.19 pm.xcarchive/Products/Applications/[AppName].app/info.plist to confirm that both NSLocalNetworkUsageDescription and NSBluetoothAlwaysUsageDescription are in there, which they are.
I've followed solutions to similar issues but have not had any success yet.
One of these solutions said to ensure that when viewing the info.plist in Xcode, make sure the target app is checked/selected in the File Inspector on the right side. Doing this causes the archive to fail with the following error:
1) Target '[AppName]' (project '[AppName]') has copy command from '/Users/jonathanredford/.../Projects/[AppName]/ios/[AppName]/Info.plist' to '/Users/jonathanredford/Library/Developer/Xcode/DerivedData/[AppName]-byufdhksjujqvwfyfegsqgpdvhow/Build/Intermediates.noindex/ArchiveIntermediates/[AppName]/InstallationBuildProductsLocation/Applications/[AppName].app/Info.plist'
2) Target '[AppName]' (project '[AppName]') has process command with output '/Users/jonathanredford/Library/Developer/Xcode/DerivedData/[AppName]-byufdhksjujqvwfyfegsqgpdvhow/Build/Intermediates.noindex/ArchiveIntermediates/[AppName]/InstallationBuildProductsLocation/Applications/[AppName].app/Info.plist'
Thank you in advance!