-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
MacOS Permission problem in VSCode #114352
Comments
Hello @berkobob. Thank you for filing this issue. Can you please provide the following information?
Please provide the information in the form of text. See how to make collapsible sections with Markdown here. |
Here is a public repo. I've included the absolute minimum necessary to reproduce the error but as this is a plugin, there is more than The output from Screenshot when run from VSCode: And this is the exact same code being run from the terminal (iTerm2): I don't know if you need this but here it the output from 'flutter run -v' when run from the terminal: |
I cannot reproduce this issue. I can see |
Can I ask you some questions then:
As you can see, I have iTerm switched on and the app works well from iTerm but not from VS Code?
|
Yes Visual Studio Code is showing up in this list, with it switched on. Looks like this issue is with VSCode not with Flutter directly. Please see https://flutter.dev/community for resources and asking questions like this, |
Just before you close this issue, I think this repo is the right place to log issues with the Flutter extension for VSCode team. Is it possible for them to take a quick look please. Thanks. |
@DanTup Do you have any insights about this that I may have missed? |
I was able to reproduce this on my M1 MacBook. I was able to force the permission prompt by pasting this into the built-in VS Code terminal:
(I got this from https://apple.stackexchange.com/questions/66981/how-can-i-add-reminders-via-the-command-line). That triggered the prompt and after accepting, running the app now shows it has permission. I'm not sure why the code in the app isn't triggering the prompt with the call to |
Thanks so much Dan. Much appreciated! Kudos. |
@DanTup Just to confirm, is this a Vscode issue or a Flutter issue? |
@exaby73 I don't know a lot about it, but it feels to me like the issue is on macOS or in the SDK used by the swift code in the app. The code was clearly asking for access to Reminders but macOS was never showing a prompt, nor adding the app to the Reminders section in the Security&Privacy section. For some reason, running a script that tries to access reminders from the terminal does trigger the prompt, allowing permission to be granted. I don't think it's a VS Code (or Dart-Code) issue. I suspect it's not a Flutter issue, but I couldn't be sure. It's possible something about how Flutter is building the macOS app is preventing that permissions prompt (or something specific about that example app), but I don't know much about how that works. I just did some searching and found this similar issue that was caused by not having a |
I'll label this issue for further investigation and insights. Thank you :) |
Has same issue when running on Android Studio. Just run by command-line or dirrectly from xcode will work fine. Otherwise, run from Android Studio - Run button has no effect (no permission request) |
I have the same issue. Macos builds from Android Studio and console are not showing the permission dialog on my machine. UPD: I am wrong, requests for permissions are going from Android Studio and Terminal, but they are linked to Android Studio and Terminal accordingly in the Privacy&Security list |
solved locally: |
I am writing a simple plugin to read, write, edit & delete Apple Reminders. The first thing I do is request access to reminders:
When I run my app from the terminal (iTerm) using
flutter run -d macOS
a window popped up to allow me to grant access to my Reminders. If I build the app and run the executable it also works. When I run my app from within VSCode, either using Debug or the VSCode terminal, the permission window does not appear and my app fails to get permission. I'm thinking this is a VSCode issue as it works everywhere else.I have the same problem on my M1 MacStudio and my Intel MacBook Pro.
How do I grant access to my Reminders to VSCode?
flutter doctor -v
[✓] Flutter (Channel stable, 3.3.6, on macOS 13.0 22A380 darwin-arm, locale en-GB) • Flutter version 3.3.6 on channel stable at /Users/antoine/library/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 6928314 (6 days ago), 2022-10-25 16:34:41 -0400 • Engine revision 3ad69d7be3 • Dart version 2.18.2 • DevTools version 2.15.0[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/antoine/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A400
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• 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 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.72.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.50.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.0 22A380 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.87
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
The text was updated successfully, but these errors were encountered: