-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Fails to Load Info.plist in macOS with vscode and Android Studio #134191
Comments
Hi @natsuk4ze. Thanks for filing this. I am able to reproduce this as described from terminal, vscode and android studio on the latest stable, master flutter doctor -v
|
Running it in xcode also works fine. |
cc @vashworth |
This is interesting. So when I run from the terminal or VSCode, it crashes for me. The OP says it worked for them from the terminal, but it doesn't for me. So, I can confirm that the Info.plist is correct. When I looked into the If I ran the app by doing The same thing happens if I built it through Xcode. Xcode will build it somewhere in DerivedData, and if I open the The mac logs I think expose the issue: When using the .app (no crash), I got the following logs:
When using the executable (that crashes), I got the following logs:
So it looks like it's thinking iTerm (my terminal) is the one requesting the PhotoLibrary access when the executable is used and since iTerm's Info.plist doesn't have a key for NSPhotoLibraryUsageDescription, it crashes. Not sure on the fix here, but I'm pretty sure that's the problem. |
Hello everyone. In my current environment, it no longer crashes in vscode. Instead, whenever I do a [✓] Flutter (Channel beta, 3.19.0-0.2.pre, on macOS 14.3 23D56 darwin-arm64, locale ja-JP)
• Flutter version 3.19.0-0.2.pre on channel beta at /Users/_/Hack/Tools/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c1df7d07ac (3 weeks ago), 2024-01-17 15:42:07 -0800
• Engine revision 4f18bb4dcb
• Dart version 3.3.0 (build 3.3.0-279.0.dev)
• DevTools version 2.31.0
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/_/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.14.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.85.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.81.20231227
[✓] Connected device (5 available)
• A063 (mobile) • 192.168.1.6:41093 • android-arm64 • Android 13 (API 33)
• iPhone 13 mini (mobile) • 00008110-0019388A3E98801E • ios • iOS 17.4 21E5184i
• iPhone 15 (mobile) • 345670C7-4E97-4F45-82C6-6411FA62B829 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.3 23D56 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 121.0.6167.139
[✓] Network resources
• All expected network resources are available.
• No issues found! |
Regarding the bug discussed here earlier (i.e. permissions not working right for macOS builds launched from VSCode or Android Studio), I've gathered some likely-relevant discussions for reference:
For what it's worth, my workflow for debugging anything involving Calendar or Reminders macOS permissions right now is:
|
Could we identify if this is a Flutter issue or an Apple issue? Something related: |
Is there an existing issue for this?
Steps to reproduce
Expected results
A permissions dialog will appear, or if already allowed, nothing will happen.
At least it does not crash.
Actual results
Info.plist does not load properly and crashes.
If I run
flutter run -d macos
from a terminal app on a mac, it does not crash and works fine.With vscode, the app crashes whether I run it from the GUI or from the terminal.
Android studio shows a crash report in addition to the crash. If I select
re-open
in that window, the app runs fine. I think this is a clue to the solution. Furthermore, it seems that info.plist is not loaded properly, as you can see from the following log in that crash report.However, when I check to see if the key exists from the application, I find that it is loaded correctly. The steps to check thet are as follows
Similar issue #70374
Screenshots or Video
Screenshots / Video demonstration
crash_in_android_studio.mov
crash_in_vscode.mov
Logs
Logs
For more:
crash_log.txt
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: