Skip to content

[Bug]: Swift Package does not obey BYPASS_PERMISSION_LOCATION_ALWAYS setting #1763

@pento

Description

@pento

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

  1. flutter create --platforms=ios geolocator_package_bug
  2. Set your pubspec.yaml to enable swift package manager:
flutter:
  config:
    enable-swift-package-manager: true
  1. Add geolocator to your dependencies, along with a package that still uses Pods (eg, flutter_keyboard_visibility), to force the Podfile to be created.
  2. To generate the initial Podfile: flutter build ios --release
  3. Add the config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'BYPASS_PERMISSION_LOCATION_ALWAYS=1'] section to the Podfile, as defined in the README.
  4. flutter clean && flutter build ios --release
  5. strings build/ios/iphoneos/Runner.app/Runner | grep -c "requestAlwaysAuthorization"

Expected results

% strings build/ios/iphoneos/Runner.app/Runner | grep -c "requestAlwaysAuthorization"
0

Actual results

% strings build/ios/iphoneos/Runner.app/Runner | grep -c "requestAlwaysAuthorization"
1

Code sample

No additional code required.

Screenshots or video

No response

Version

14.0.2

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.35.7, on macOS 26.2 25C56 darwin-arm64, locale en-AU)
    ! Flutter version 3.35.7 on channel [user-branch] at /Users/pento/Projects/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.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 2025.2)
[✓] VS Code (version 1.107.1)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for Your iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions