i create flutter project with "Flutter create myapp" and "cd myapp", and the next i'll try run Flutter Run, but my output is:
I have a current stable version of Flutter and the recent sdk Android Q published.
This is my flutter doctor -v:
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [versão 10.0.18363.657], locale pt-BR)
• Flutter version 1.12.13+hotfix.8 at C:\src\flutter
• Framework revision 0b8abb4724 (18 hours ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\lucas\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.42.0)
• VS Code at C:\Users\lucas\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.8.1
[√] Connected device (1 available)
• SM J610G • 061f9b46 • android-arm • Android 9 (API 28)
• No issues found!
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 months ago.
Improve this question
I am getting this error while running the flutter application targeting windows. The project is running on android and the web.
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
Exception: Unable to generate build files
And in the console
flutter doctor -v
After running flutter doctor,
C:\Users\ibrahim42386>flutter doctor -v
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.22616.100], locale en-US)
• Flutter version 3.3.4 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision eb6d86ee27 (6 days ago), 2022-10-04 22:31:45 -0700
• Engine revision c08d7d5efc
• Dart version 2.18.2
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\ibrahim42386\AppData\Local\Android\Sdk
• Platform android-32, build-tools 31.0.0
• ANDROID_HOME = C:\Users\ibrahim42386\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Users\ibrahim42386\AppData\Local\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.5)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.3.32922.545
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.3)
• Android Studio at C:\Program Files\Android\Android Studio
• 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.13+0-b1751.21-8125866)
[√] VS Code (version 1.71.2)
• VS Code at C:\Users\ibrahim42386\AppData\Local\Programs\Microsoft
VS Code
• Flutter extension version 3.50.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22616.100]
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.77
• Edge (web) • edge • web-javascript • Microsoft Edge 105.0.1343.33
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
What should I do to run this project on windows?
When i try to build my flutter project in xcode or via "flutter build ios" command i get this error:
This is the flutter doctor output:
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.2 21D49 darwin-arm, locale it-IT)
• Flutter version 2.8.1 at /Users/Fenix/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (7 settimane fa), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/Fenix/Library/Android/sdk
• Platform android-31, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio M1.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.11+0-b60-7772763)
[✓] Android Studio (version 2021.1)
• 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.11+0-b60-7590822)
[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)
I tried with checking "For install builds only" in Build Phases but i get different error of files not found.
I also tried with flutter clean, Clean Build Folder, pod reinstall, etc.
Thanks a lot.
I solved by using this command to build:
flutter build ios -t lib/splashscreen.dart --release
Where splashscreen.dart is the entrypoint for your app, where void main() => runApp(...) is placed.
Thanks for all comments.
you have forgotten in your code to add void main => runapp(/your class which contains materialapp()/)
I cloned the repo and Installed Visual Studio and all the necessary tools as stated on the flutter website for windows applications. I have been using flutter for a while now so I have Visual Studio Code installed and configured for flutter. But when I run "flutter run -d windows" I get the error which says:
/D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/visibility_detector-0.2.0/lib/src/visibility_detector_layer.dart(276,21): error G69E91ED9: Too many positional arguments: 1 allowed, but 2 found. [C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\flutter\flutter_assemble.vcxproj]
D:\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(242,5): error MSB8066: Custom build for 'C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\CMakeFiles\3350ef37c8b8b08ac8c1be72abc20593\flutter_windows.dll.rule;C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\CMakeFiles\c9ea6ec0dd188632dc4dfb02305c9fe9\flutter_assemble.rule' exited with code 1. [C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\flutter\flutter_assemble.vcxproj]
Below is the output of flutter doctor -v
flutter doctor -v
[√] Flutter (Channel dev, 2.9.0-0.1.pre, on Microsoft Windows [Version 10.0.22000.376], locale en-US)
• Flutter version 2.9.0-0.1.pre at D:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8f1f9c10f0 (3 weeks ago), 2021-12-14 13:41:48 -0800
• Engine revision 234aca678a
• Dart version 2.16.0 (build 2.16.0-80.1.beta)
• DevTools version 2.9.1
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\GTL-DAN-002\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.4)
• Visual Studio at D:\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.0.32014.148
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• 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.10+0-b96-7249189)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\GTL-DAN-002\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.32.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.376]
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110
• Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.62
! Device 04669259A7007526 is not authorized.
You might need to check your device for an authorization dialog.
• No issues found!
[flutter] flutter.bat doctor -v
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.778], locale en-GB)
• Flutter version 1.12.13+hotfix.9 at D:\flutter\flutter
• Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\vrind\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Users\vrind\AppData\Local\Android\Sdk
X Android SDK file not found: C:\Users\vrind\AppData\Local\Android\Sdk\platforms\android-28\android.jar.
• Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.44.2)
• VS Code at C:\Users\vrind\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.10.1
[√] VS Code, 64-bit edition (version 1.26.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.10.1
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
! Doctor found issues in 1 category.
exit code 0
check you ANDROID_HOME path in environment variable. if not exist then create a path with name ANDROID_HOME and set the android sdk location to the path. if exist then check the location.
I met this error, turn out I didn't add ANDROID_HOME path in the environment variable. You may want to check it again
I'm getting error when trying to debug a newly created project in flutter. This is the LOG before the error.
[ +1 ms] executing: C:\Users\pfernandes\AppData\Local\Android\sdk\platform-tools\adb.exe -s 0123456789ABCDEF shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true --ez start-paused true com.mycompany.my_app_pos_payment_app/com.mycompany.my_app_pos_payment_app.MainActivity
[ +696 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.mycompany.my_app_pos_payment_app/.MainActivity (has extras) }
[ ] Waiting for observatory port to be available...
[ +4 ms] Error waiting for a debug connection: Bad state: No element
[ ] Error launching application on N910.
I can debug without any problem a pure Android project.
This is my flutter doctor:
[√] Flutter (Channel master, v1.14.7-pre.45, on Microsoft Windows [Version 10.0.17763.914], locale en-US)
• Flutter version 1.14.7-pre.45 at c:\sdk\flutter
• Framework revision 9375377fa9 (2 hours ago), 2020-01-30 09:36:41 -0800
• Engine revision f6526c0cf8
• Dart version 2.8.0 (build 2.8.0-dev.6.0 fc3af737c7)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\pfernandes\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code, 64-bit edition (version 1.41.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.7.1
[√] Connected device (1 available)
• N910 • 0123456789ABCDEF • android-arm • Android 5.1.1 (API 22)
• No issues found!
Updating VSCode helped me to fix this problem! Try to update VSCode.
Try again after you migrate your app to AndroidX, it worked for me.
You can follow this doc to learn more about AndroidX migration
The problem needed a firmware update to be solved.