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

Apple TestFlight rejected the app stating that there's a missing NSMicrophoneUsageDescription setting in the Info.plist file. #1397

Closed
PritamSangani opened this issue Jan 29, 2025 · 3 comments
Assignees
Labels
1 backlog bug Something isn't working

Comments

@PritamSangani
Copy link

Which API doesn't behave as documented, and how does it misbehave?
Apple TestFlight rejected the app stating that there's a missing NSMicrophoneUsageDescription purpose string in the Info.plist file.

Minimal reproduction project
Could use the example app with SwiftPM enabled

To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:

  1. Build the app with the env variable AUDIO_SESSION_MICROPHONE=0 set
  2. Upload to testflight
  3. Build will be rejected and an email sent stating that there's a missing NSMicrophoneUsageDescription purpose string in the Info.plist file.

Error messages

Email received from Apple:

ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “Runner.app” bundle should contain a NSMicrophoneUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources.

Expected behavior
The code requiring microphone access should be excluded from the compiled app and should not be rejected by the App Store with the above reason.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):
N/A being rejected by App store before it can be installed on a device

Flutter SDK version

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.2, on macOS 15.1.1 24B91 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google
    Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3.2)
[✓] VS Code (version 1.94.2)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

Additional context

just_audio: 0.9.44

I believe the issue is related to this comment you made here: flutter/flutter#161182 (comment).

I have added a comment on the PR that is now merged here where I believe you have missed to add this line in the Package.swift file:
.define("AUDIO_SESSION_MICROPHONE", to: ProcessInfo.processInfo.environment["AUDIO_SESSION_MICROPHONE"] ?? "0")

@PritamSangani PritamSangani added 1 backlog bug Something isn't working labels Jan 29, 2025
@ryanheise
Copy link
Owner

This is handled by audio_session, not just_audio, but in order for it to work, you just have to make sure you run flutter clean.

@ryanheise
Copy link
Owner

In a future release of audio_session, I also plan to make "0" the default since I think this is more common, and it should eliminate some of the hassle.

If you've already run flutter clean and it's still not working, then it can't be because of the cSettings thing, that part should work with flutter clean. But there was another change to the latest audio_session which could influence things. So if you still have the issue after running flutter clean, let me know and I'll look into the other thing.

@PritamSangani
Copy link
Author

Hey @ryanheise, thanks for responding so quickly. Turns out running flutter clean did fix the issue. Thanks for your help!

@ryanheise ryanheise pinned this issue Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants