[Question]: Do Xcode.app builds need PERMISSION_HANDLER_INFO_PLIST? The manifest finds my app through the plugin symlink
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 54/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- documentation, mobile
Hướng nghiên cứu
Read the “Builds started from Xcode.app” section in the permission_handler_apple README and the findAppRoot() comment in Package.swift; compare their discovery assumptions with the Flutter symlink setup described in the issue. Check whether the observed behavior applies to the documented setup, then update the README and comment if needed. Done when the guidance accurately explains when PERMISSION_HANDLER_INFO_PLIST is required.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Please check the following before submitting a new issue.
- I have searched the existing issues.
- I have carefully read the documentation.
Please select for which platform(s) you need help
- Android
- iOS
- Windows
Your question
The permission_handler_apple README section "Builds started from Xcode.app" and the findAppRoot() comment in Package.swift say that a build started from Xcode.app cannot find the app, so it needs PERMISSION_HANDLER_INFO_PLIST.
In my Flutter app, a build started from Xcode.app found the app without that variable. All the PERMISSION_* macros that match my Info.plist keys were enabled. Is the README statement about a specific setup, or must the README change?
Environment
- permission_handler_apple 9.6.4. The README text and
findAppRoot()onmainare the same as in 9.6.4. - Flutter 3.44.9 (stable), Swift Package Manager enabled
- Xcode 27.1
- A normal Flutter app with flavors (not an add-to-app module)
- No
PERMISSION_*orPERMISSION_HANDLER_*value is set withlaunchctl setenv.
Steps
- Quit Xcode.
- Move the project's DerivedData folder and
~/Library/Caches/org.swift.swiftpm/manifeststo the Trash. - Open
ios/Runner.xcworkspacein Xcode.app and run the app on a simulator (Debug configuration). - Inspect the built
Runnerbinary in DerivedData.
Result
otool -oV Runnershows instance methods forLocationPermissionStrategy(7),AudioVideoPermissionStrategy(3),PhotoPermissionStrategy(4) andNotificationPermissionStrategy(4). The strategies for permissions without anInfo.plistkey (ContactPermissionStrategy,BluetoothPermissionStrategy, and others) have no methods.- The binary contains the
MISSING_WHENINUSE_PERMISSIONstring. This string is compiled only whenPERMISSION_LOCATIONis 1.
Why it works (my reading)
Flutter adds each plugin to the app as a symlink:
<app>/ios/Flutter/ephemeral/Packages/.packages/permission_handler_apple-9.6.4
-> ~/.pub-cache/hosted/pub.dev/permission_handler_apple-9.6.4/ios/permission_handler_apple
Xcode.app appears to compile the manifest at the symlink path. The SwiftPM manifest cache on my machine has only this path for the plugin:
<app>/ios/Flutter/ephemeral/Packages/.packages/permission_handler_apple-9.6.4/Package.swift
If that is correct, #file is inside the app. Then the third start point in findAppRoot() (the #file walk-up) reaches the app root, although the working directory is / and PWD is not set.
The swift package CLI resolves the symlink to ~/.pub-cache, and from there #file cannot reach the app. So the comment "#file is canonicalised by SwiftPM" matches what I see with the CLI, but not with Xcode.app.
Questions
- Is the README statement about a specific setup? For example, an add-to-app module (#1572), or a Flutter version that does not add plugins as symlinks.
- If not, can the section say that for a normal Flutter app, Xcode.app builds find the app through the
#filepath, and thatPERMISSION_HANDLER_INFO_PLISTis needed only when discovery fails?
I saw the symlink behavior with Xcode 27.1. I did not find SwiftPM documentation for it, so a later Xcode can change it. If you agree, I can open a PR for the README and the findAppRoot() comment.
Version
9.6.4
- Ngôn ngữ chính
- Dart
- Star
- 2.2k
- Fork
- 984
- Merge trung bình
- 4 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Baseflow/flutter-permission-handler
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
[Bug]: Missing `== 0` inverts the `openAppSettings` check in permission_handler_windows_plugin.cppCó thể đã có người làm @Seungpyo1007 đã nhận 62 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
permission_handler_apple SwiftPM does not auto-detect Info.plist for Flutter module .ios layoutĐang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 65/100
Baseflow/flutter-permission-handler#1572 · 2 bình luận · 1 reaction ·
Tất cả issue của Baseflow/flutter-permission-handler
Issue tương tự
-
BUG: App crashes on iOS when initializing speech-to-text due to missing microphone and speech recognition keys in Info.plistCó thể đã có người làm @AyushSrivastava1818 đã nhận hôm nay. Đang mởbug enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/Ell-ena#365 · 2 bình luận ·
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
VeryGoodOpenSource/vgv-ai-flutter-plugin#219 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
cucumber/gherkin#766 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Anxcye/anx-reader#1024 ·
-
[cloud_functions]: Apple platforms ignore custom domains passed as regionCó thể đã có người làm @ragavendranbala-TSL đã nhận hôm nay. Đang mởNeeds Attention platform: ios platform: macos plugin: functions type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
firebase/flutterfire#19015 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày