Tried to build a basic linux app following the official Flutter google-colab tutorial and got stuck with this error
Launching lib/main.dart on Linux in debug mode...
lib/main.dart:1
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal)
flutter/CMakeLists.txt:25 (pkg_check_modules)
Exception: Unable to generate build files`
OS: Linux Mint
IDE: VScode
Tried to find the missing modules so i could install. Was unsuccessful. Need more expertise in that part. Please help :)
edit: installed libgtk-3-dev since it was a requirement as stated from flutter doctor
which said
root#lax:/home/lax/Flutter/vibeo# flutter doctor
Woah! You appear to be trying to run flutter as root.
We strongly recommend running the flutter tool without superuser privileges.
/
📎
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on Linux Mint 21.1 5.15.0-57-generic, locale en_IN)
Checking Android licenses is taking an unexpectedly long time...[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✗] Linux toolchain - develop for Linux desktop
✗ GTK 3.0 development libraries are required for Linux development.
They are likely available from your distribution (e.g.: apt install libgtk-3-dev)
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.74.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability
! Doctor found issues in 2 categories.
and still the build fails
Launching lib/main.dart on Linux in debug mode...
lib/main.dart:1
ERROR: Flutter failed to create a directory at "/home/lax/Flutter/vibeo/.dart_tool/flutter_build/a631d39312be8637492918f28fa31d2e".
Exception: Build process failed
Exited (sigterm)
Related
I'm new to flutter and I want to make the default flutter app to show up on my Android emulator. The emulator starts up fine but the process fails at "gradle task assembleDebug". I reinstalled everything ranging from Android Studio to flutter and dart and also deleting the AVD from Android Studio then creating it again but nothing seems to work. I tried a few potential fixes from youtube and google searches involving running a "gradle wrapper" command at the root directory but that doesn't work too as the root directories of all flutter apps lacks the "build.gradle" file. Flutter doctor does not show any problems.
"flutter doctor" command output:
PS C:\Users\Mahmud Alam\Desktop\Programming Stuff\Flutter&Dart\newproj\firstapp> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.1, on Microsoft Windows [Version 10.0.22000.675], locale en-US)
Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.10)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.67.2)
[√] Connected device (4 available)
[√] HTTP Host Availability
• No issues found!
Error output in command line:
PS C:\Users\Mahmud Alam\Desktop\Programming Stuff\Flutter&Dart\newproj\firstapp> flutter run
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib\main.dart on sdk gphone x86 in debug mode...
'Dart\newproj\firstapp\android\' is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
Running Gradle task 'assembleDebug'... 19.6s
Exception: Gradle task assembleDebug failed with exit code 1
I get the feeling that something is missing from somewhere but I cant figure out where and how to restore the files that are missing. Also, I'm running an emulation of Pixel 2 API 30 (android x86). But that alone should not cause any problems. How do I fix this?
Edits: [Folder Structure Screenshots]
I think this is your "&" of Flutter&Dart which cause the problem.
Try running flutter clean in your terminal and then rebuilding the app, that's worked for me in the past.
Delete the flutter cache (/bin/cache);
Delete gradlew and gradlew.bat in android folder (and in some cases android/gradle/wrapper/gradle-wrapper.jar too);
Run flutter run again.
This steps worked for me.
I am trying to install flutter in kali linux machine. I installed flutter from official website and followed accordingly. I don't want to use android studio so I am using visual studio code.
when I run Flutter doctor in terminal i get
[✓] Flutter (Channel master, 2.2.0-11.0.pre.161, on Linux, locale en_IN)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[☠] Linux toolchain - develop for Linux desktop (the doctor check crashed)
✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at
https://github.com/flutter/flutter/issues.
✗ ProcessException: Failed to find "ninja" in the search path.
Command: ninja
[!] Android Studio (not installed)
[✓] VS Code (version 1.55.2)
[✓] Connected device (1 available)
! Doctor found issues in 4 categories.
And when i Run in visual studio i get this
Launching lib/main.dart on Linux in debug mode...
lib/main.dart:1
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Exception: Unable to generate build files
Exited (sigterm)
Can anyone help me with this issue please.
I found the solution by using this following command:
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
and
flutter config --enable-linux-desktop
you must install ninja.
sudo pacman -S ninja or sudo apt-get install ninja.
i am new to flutter, i just followed an online video on setting up flutter on my MacBook pro and i just created my first project and tried to run it while my system is connected to the internet but got this error bellow
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
Exception in thread "main" java.lang.RuntimeException: Could not load wrapper properties from '/Users/bright/AndroidStudioProjects/second_flutterapp/android/gradle/wrapper/gradle-wrapper.properties'.
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:64)
at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:47)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:60)
Caused by: java.net.URISyntaxException: Illegal character in path at index 62: https://services.gradle.org/distributions/gradle-x.x.x-all.zip to gradle-6.7-all.zip
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parseHierarchical(URI.java:3105)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at org.gradle.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:81)
at org.gradle.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:70)
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:57)
... 2 more
Exception: Gradle task assembleDebug failed with exit code 1
i have see many issues like this with answers here but non fixed my issue... i have tried deleting "gradle-wrapper.jar" and Replacing "distributionUrl=https://services.gradle.org/distributions/gradle-x.x.x-all.zip to gradle-6.4.1-all.zip" on the gradle-wrapper-properties file and running the comman "flutter run" on my terminal but still get same error
i have tried "flutter doctor" which gave me the result down bellow
Brights-MBP:~ bright$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G2021 darwin-x64,
locale en-NG)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] 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.1)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
i know i have not installed Xcode which i will do later but am not sure if thats the issue
#what am i doing wrong?
Looking at the path, the error clearly stated that:
Caused by: java.net.URISyntaxException: Illegal character in path at index 62: https://services.gradle.org/distributions/gradle-x.x.x-all.zip to gradle-6.7-all.zip
When checking the file gradle-x.x.x-all.zip in services.gradle.org/ distributions/, it is not existing while the gradle-6.7-all.zip was found. So it could be a big factor that there was an error copying the distributions path. The proper file should be gradle-6.7-all.zip.
Also, you've mentioned that this was the first time Flutter was setup in your MacOS. With this, you can always check the guide from the Flutter documentation about macOS install for any missed steps/processes.
The error shows your characters in "distributionUrl=https://services.gradle.org/distributions/gradle-xxx-all.zip to gradle-6.4.1-all.zip"
Just change it to something like this:
enter image description here
I am repeatedly getting this error again and again despite trying everything I could find online.
So far I have done these steps to solve this problem:
Removed android stuido, intelliJ and flutter and installed all of it again.
Reinstalled all SDK packages several times, i have attached image of all SDK packages for refernece.Please have a look.
Accepted all licenses.
C:\Users\Asus>flutter doctor --android-licenses
All SDK package licenses accepted.======] 100% Computing updates...
C:\Users\Asus>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.1, on Microsoft Windows [Version 10.0.18363.836], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc4)
[√] Android Studio (version 3.6)
[√] Connected device (1 available)
• No issues found!
Tried using earlier version of flutter and tried again after upgrading it.
After doing all this I am still getting this error for all projects. Even the basic project which is pre-written when creating a new flutter project.
Launching lib\main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
Exception: Gradle task assembleDebug failed with exit code -1
After Xcode code build flutter run
ProcessException: Process timed out:
Command: /usr/bin/env xcrun xcodebuild -configuration Debug -quiet -workspace
Runner.xcworkspace -scheme Runner
BUILD_DIR=/Users/Huzeifah/Documents/flutter_development/test_app/build/ios
-sdk iphonesimulator -arch x86_64
SCRIPT_OUTPUT_STREAM_FILE=/var/folders/w8/nf0h0vbj01v4qz3wbk07fvnr0000gn/T/flu
tter_build_log_pipe.O5hXp2/pipe_to_stdout FLUTTER_SUPPRESS_ANALYTICS=true
COMPILER_INDEX_STORE_ENABLE=NO -showBuildSettings
All version information when run flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.3 19D76, locale en-PK)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.45.1)
[✓] Connected device (1 available)
! Doctor found issues in 2 categories.
When I run flutter. Xocde build done then give the Error ProceesTimw out. Then I try every thing that i can try. I install new vwesion of Xcode 11.4.1 and flutter new version 1.17 stable enter image description here
For me, I had the same issue and resolved it by moving my project out of a folder that iCloud was backing up. I had moved to a place with slower wifi, so my project kept hanging. Now, it loads faster than it did before.
Credit here (iOS simulator not working or taking so much time in Flutter)
This usually happens when you update xcode to fix this use Flutter upgrade in your general terminal and go to your project code editor and run Flutter clean and run flutter run if you face any other issues let me know......