Flutter Desktop Application Running error MSB4100 - windows

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.

Related

How to fix flutter doctor error android studio not installed, and IntelliJ IDEA, even though I've installed it already

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 can't use Xcode simulator in VSCode (CocoaPods error)

Working with Flutter I tried to use Xcode simulator and I get the error in the picture.
I searched everywhere and following all the possible solutions but nothing is right (gem install commands, pod install(*[!] No Podfile found in the project directory*.), brew commands...).
However, if I tried the last app that I made and I have no problems running the simulator. Why with this project? Thank you in adv!
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.26.0-2.0.pre.131, on Mac OS X 10.15.7 19H15 darwin-x64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.52.1)
[✓] Connected device (2 available)
• No issues found!
Screenshot
Redit:
I figured it out. So it was missing 'a folder' or 'a file' in the IOS folder (either with or without Pods folder).
I do not know what was it to be more specific since I just change the directory (cd <your iOS folder>) and then recreate or update the folder (<flutter create .> .
You'll see that something will update then you can either try the pod install command or give it a shot and try the simulator (remember to go back to your project folder though) .

Migration from Windows to Mac: Error on Podfile installation

I just migrated a flutter app made on Windows10, to the Mac, and had problems with the app's execution. I searched the internet for similar errors and found several solutions, but none of them solved my case. I tried to delete the files podfile.lock, Podfile, .symlinks, Flutter.Frameword, Fullet.podspec, pubspec.lock, and after that, the code execution (with flutter run) returned this:
Error running pod install
I tried to run this line of code:
"pod install --repo-update"
And I received this:
[!] Unable to find a target named 'FirebaseApp' in project 'Runner.xcodeproj', did find 'Runner'.
I've tried several things and I don't know what's going on.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.51.0)
[✓] Connected device (1 available)
• No issues found!
My app is connected to Firebase, android, and I'm studying flutterfire with iOS.
Open the terminal, navigate to the project, and type rm ios/Podfile
After that build the project with flutter build ios

Android studio keeps showing "Loading..." on device selector

I got stuck in this problem for several days, my android studio suddenly keep showing 'Loading...' on its device selector when there are active android emulator or connected to android device.
i use mac os catalina 10.15.5 and here is some clue that might help :
siekoo-mac:~ siekoo$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin
code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.0)
[✓] Connected device (1 available)
siekoo-mac:~ siekoo$ adb devices
List of devices attached
16fb14c20205 device
Ive tried several solutions, like run invalidate & cache restart on android studio, reinstalling adb platform tools, reinstalling android SDKs or even downgrade/upgrade the android studio, all doesnt end with good result. For now, i run my project on android device via terminal
In my case it was due to different compile and target SDK versions inside app level gradle and library gradle. It was resolved by changing sdk versions from 26 to 29 in both.
Open another android project in new window (not a flutter project). Now you have two windows of android studio.
then device will detect on Android project. You will be able to connect your device for native android project. Then try again to detect device on flutter project.
Your device will show here.
This worked for me.
maybe
Open in Android Studio - Preferences | Languages & Frameworks | Flutter
Set path SDK .../SDK/flutter

gradle keeps crashing, tried deleting gradle folders already,even tried reinstalling all my IDEs including java,flutter etc

im using the default flutter app
error apears on vs code intellij and android studio
using 8 GB ram laptop
C:\src\flutter\bin\flutter.bat --no-color doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.6.0, on Microsoft Windows [Version 10.0.17134.228], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[√] Android Studio (version 3.1)
[√] Connected devices (1 available)
• No issues found!
Process finished with exit code 0
e:\b\build\slave\windows_engine\build\src\third_party\dart\runtime\vm\thread_pool.cc:
341: error: Could not start worker thread: result = 22. Dumping native
stack trace for thread 1ed0 [0x00007ff6205f5a0b] Unknown symbol
[0x00007ff6205f5a0b] Unknown symbol
-- End of DumpStackTrace
Gradle was downloading pgks with each launch try, some were unreachable, probably my current location issues,
anyway finally it came through - it took a lot of time though.

Resources