I'm a fairly newbie in Flutter, but ran into a super weird problem. Well, while I run the my code as "Desktop Windows" it blocks the system clipboard in windows. I mean, I can't copy anything to the clipboard IN THE WHOLE SYSTEM.
What is the problem and how to solve it? It's a bug or Flutter feature?
Frankly speaking, it's very annoying when during development I can't copy pieces of code or funny kittens to my friends on Discord.
The only way to stop it is to turn off the application.
How to repeat it:
Run the application written in Flutter as "Desktop Windows" (it does not matter whether in the code editor or the previously built one)
Run cmd / powershell and execute the command:
PS C:\Flutter\MySuperSimpleApp> echo "fubar" | clip
ERROR: Permission Denied
Or try to copy and paste anything from/to any other windows application
P.S. My environment
System: Windows 11 Pro
Version: 21h2
Build: 22000.675
Flutter 3.1.0-0.0.pre.671 • channel master • https://github.com/flutter/flutter.git
Framework • revision 32f61bc365 (7 days ago) • 5/12/2012 13:49:08 -0400
Engine • revision 35c770101a
Tools • Dart 2.18.0 (build 2.18.0-106.0.dev) • DevTools 2.13.1
Its probably a bug:
https://github.com/flutter/flutter/issues/103205
Currently still not solved.
Related
I followed https://medium.com/flutter-community/publishing-flutter-windows-apps-to-microsoft-partner-center-with-codemagic-b1962575510c but the channel dev and beta do not have the option to enable uwp:
Flutter 3.1.0-9.0.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision f28e570c8c (5 weeks ago) • 2022-06-14 13:39:33 -0500
Engine • revision 74ee6b5afd
Tools • Dart 2.18.0 (build 2.18.0-165.1.beta) • DevTools 2.14.0
PS C:\Users\lz> flutter config --enable-windows-uwp-desktop
Could not find an option named "enable-windows-uwp-desktop".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
channel dev (which is deprecated) also gives the same error.
On stable it has the option:
[✓] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1288], locale en-GB)
PS C:\Users\me> flutter config --enable-windows-uwp-desktop
Setting "enable-windows-uwp-desktop" value to "true".
You may need to restart any open editors for them to read new settings.
However when I do flutter create myapp, it only has a windows folder (win32) not a winuwp like it should.
I'm on Windows 10, fresh Flutter and Visual Studio SDK installation with Windows 10 SDK C++ installed.
As UWP is being phased out by Microsoft, the Flutter team is focusing on the Win32 side instead to limit the scope. The support for UWP was removed entirely here.
Check out the main issue here: https://github.com/flutter/flutter/issues/14967#issuecomment-1085490495
So, what I was trying to do is to build Windows desktop apps with Flutter. I just followed all the steps of installation that were written in the documentation of Flutter. I just created a simple boilerplate with the command flutter create learningflutter on my Windows 11 machine. Then I just run the flutter run -d windows command inside the directory (learningflutter), then ended up with this error:
$ flutter run -d windows
Launching lib\main.dart on Windows in debug mode...
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(469,26): error MSB4100: Expected "$([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))" to evaluate to a boolean instead of "$([System.String]::new('..\flutter\Debug\flutter_wrapper_app.lib;D:\Adil's Files\My Code\learningflutter\windows\flutter\ephemeral\flutter_windows.dll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib').Contains('atls.lib'))", in condition "'$(ATL_KeyFile)' != '' and ('$(ConfigurationType)' == 'Application' or '$(ConfigurationType)' == 'DynamicLibrary') [D:\Adil's Files\My Code\learningflutter\build\windows\runner\learningflutter.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(469,26): error MSB4100: and %(Link.AdditionalDependencies) != '' and $([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))". [D:\Adil's Files\My Code\learningflutter\build\windows\runner\learningflutter.vcxproj]
Building Windows application...
Exception: Build process failed.
I was looking for how to fix this problem. Would be appreciated if you teachers can help me out with this problem!
My Flutter Doctor configuration:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.13.0-0.0.pre.498, on Microsoft Windows [Version 10.0.22593.1], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.3)
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.66.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
You can say that I have literally no idea about Flutter, and never made a mobile app with it. So, you can treat me a newbie and please explain why you did this or that or whatever so that I can learn.
If you need more information, please ask for it explicitly. I never dealt with these problems before so I don't really know specifically what to include as a reference! Thanks for your consideration!
Thank you Sir/Ma'am!
Make sure that you downloaded cmdline-tools
Run path/to/sdkmanager --install "cmdline-tools;latest"
and for the sdk license issue you may check this.
I'm trying to start the emulator with this command emulator -avd Pixel_4_API_30 but it gives me an error:
[8633370112]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/Users/primulax/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory
Android Studio specs:
Build #AI-203.7717.56.2031.7935034, built on November 21, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.2
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
✅ I was able to run with ~/Library/Android/sdk/emulator/emulator -avd Pixel_4_API_30 with this command
Use ~/Library/Android/sdk/emulator/emulator instead of ~/Library/Android/sdk/tools/emulator on MacOS, for Ubuntu use ~/Android/Sdk/emulator/emulator.
I just experienced the same issue on a freshly setup machine, emulator installed through SDK manager and all.
The error message says it all actually: If you go to /Users/primulax/../emulator/qemu/ on your machine, you'll notice that of course there is no darwin-x86_64 directory, but darwin_aarch64, since you are on an M1 machine. Whatever the reason is the emulator looks in the wrong directory, if you just duplicate the darwin_aarch64 folder and name your copy darwin-x86_64, it works as intended. Not ideal, but it's a workaround until this path-problem is fixed.
Edit: Please take a look at #Andrew Stromme's comment. Of course symlinking is a much more elegant solution to this problem!
If you have Android Studio installed, you can run the emulator from terminal without having started Android Studio first.
First of all, run
cd ~/Android/Sdk/tools && ./emulator -list-avds
to get a list of all the available Android virtual devices that you have installed.
Then, copy the name of the virtual device you want to use and run
cd ~/Android/Sdk/tools && ./emulator -avd YOUR_DEVICE_NAME
where you replace "YOUR_DEVICE_NAME" with the name of a virtual device that was listed in the installed virtual devices list.
This info and more that you may find useful can be found in the official documentation.
Now for the error you get it's most possibly due to a wrong file path. It seems that others have also faced this issue and a bug has been opened before here. The most common solution proposed is to launch emulator from the
/path/to/android-sdk/tools
directory in command line.
Also, before trying this or any other solution listed in this issue tracker, firstly make sure that you have installed from the SDK Manager the Android Emulator in SDK Tools.
I'm a beginner at learning flutter. I've installed Android Studio and flutter. I ran the command flutter --version on Windows Powershell and the output I received is Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision f4abaa0735 (2 months ago) • 2021-07-01 12:46:11 -0700 Engine • revision 241c87ad80 Tools • Dart 2.13.4
The next command I ran was flutter doctor and I received output as:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19041.1165], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Cannot execute C:\Users\lenovo\IntelliJ IDEA Community Edition 2021.1\bin\java to determine the version
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (not installed)
[√] Connected device (3 available)
! Doctor found issues in 3 categories.
Can anyone please help me in fixing this issue?
I've the same issue on Windows. This does not seem to happen on Linux (Ubuntu) for me.
But it's a warning you can ignore. Even if Flutter Doctor does not recognize Android Studio, you can still use it in Android Studio if everything else is set up.
I have clicked on Tools -> Android -> Android Device Monitor in VS 2015 and got the following error, but my xamarin android player works fine.
Is there a way to access to local database (sqlite) in the xamarin android player simulator not on the physical device?
Update:
I am using adb and getting the following error
Failed to load the JNI shared library "C:/XXXXX/jvm.dll"`.
This is a sign of a mixed 32/64 Java bit Java install and/or the wrong version is installed.
Xamarin on Windows requires a Windows x86 version of v1.7
It is essential to install the 32-bit version of the Java JDK even if you're using 64-bit Windows. It is also important that v1.7 of the Java JDK is installed (although it is fine to have 1.8 or newer installed at the same time).
So I would start by installing Java v1.7, since the error is pointing to v1.6 and retrying to open the Android Device Monitor.
Installing the Java SDK (JDK)
The JDK can be downloaded from any browser by visiting Oracle’s website and browsing to the section with the heading Java SE Development Kit 7u79
Ref: https://developer.xamarin.com/guides/android/getting_started/installation/windows/manual_installation/#Installing_the_Java_SDK_JDK
Solution 1:
I run tools->android-> android adb command prompt in visual studio
I have followed the followings to access the database
step1. >adb shell
step2. >cd data/data
step3. >ls -l|grep "com.xxxx"
step4. >cd "com.xxxx"
Then I used the following to copy sql file to my workstation
adb shell "run-as com.xxxx chmod 666 /data/data/com.xxxx/files"
adb pull /data/data/com.xxxx/files/xx.sql
adb shell "run-as com.xxxx chmod 600 /data/data/com.xxxx/files"
Then I have downloaded sqlite browser to open the file and see the tables.
Solution 2:
Alternatively, you can go to following directory and double click the exe file
C:\Users\XXXXX\AppData\Local\Android\ANDROI~1\tools\lib\monitor-x86_64\monitor.exe