Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

permission_handler_apple SwiftPM does not auto-detect Info.plist for Flutter module .ios layout

Aperta
#1,572 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter, swift
Ambito
mobile-dev

Direzione di ricerca

Start in permission_handler_apple/ios/permission_handler_apple/Package.swift, where isAppRoot(), findAppRoot() and findInfoPlist() decide which host project is read. The issue shows that the root check looks only in ios/ for .xcodeproj and never in .ios/, so a Flutter module's Info.plist is not found. Reproduce by inspecting the PERMISSION_CAMERA value compiled for a module layout with .ios/Runner.xcodeproj. Done when that layout resolves the host Info.plist and the camera macro is set, which you can check with the permission_handler example on an iOS Swift Package Manager build.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Info.plist contains NSCameraUsageDescription, but Permission.camera.request() returns denied without showing the native iOS camera permission popup.

The same issue can affect other iOS permissions because the SwiftPM PERMISSION_* macros may be compiled as 0.

Root Cause

In permission_handler_apple/ios/permission_handler_apple/Package.swift, isAppRoot() only detects a Flutter app root when it finds:

pubspec.yaml + ios/*.xcodeproj

Current logic:

let iosDir = dir.appendingPathComponent("ios")
guard let entries = try? fileManager.contentsOfDirectory(atPath: iosDir.path) else {
    return false
}
return entries.contains { $0.hasSuffix(".xcodeproj") }

Flutter modules use:
pubspec.yaml + .ios/*.xcodeproj

Because .ios is not checked, findAppRoot() cannot locate the Flutter module host project. Then findInfoPlist() returns an empty dictionary, and macros like PERMISSION_CAMERA resolve to 0.

As a result, Permission.camera.request() returns denied without triggering the native iOS permission dialog.

Package

permission_handler / permission_handler_apple

Versions
  • permission_handler: 13.0.2
  • permission_handler_apple: 9.6.2
  • Flutter: 3.47.7
  • Xcode: 26.6
Platform

iOS using Swift Package Manager in a Flutter module project.

Project Layout

This is a Flutter module, so the generated iOS host project is under .ios, not ios:

sw_fc_flutter/
  pubspec.yaml
  .ios/
    Runner.xcodeproj/
    Runner/
      Info.plist
Lingua principale
Dart
Stelle
2.2k
Fork
979
Merge medio
2g 7h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Baseflow/flutter-permission-handler

Tutte le issue di Baseflow/flutter-permission-handler

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.