I'm using M1 Mackbook air.
This is the result of installing Flutter-related extensions, Android Studio, and Android SDK and running Flutter Doctor.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 12.1 21C52 darwin-arm, locale
ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✗] 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 see
https://guides.cocoapods.org/using/getting-started.html#installation for
instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.74.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
When executing Debug in the lib/main.dart file of the project created using flutter create, the following error appears. (the Android emulator specs are: Pixel 4, Android 10)
Launching lib/main.dart on Android SDK built for arm64 in debug mode... lib/main.dart:1
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:processDebugResources' (type 'LinkApplicationAndroidResourcesTask').
- In plugin 'com.android.internal.version-check' type 'com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask' property 'androidJarIn
put.androidJar' specifies file '/Users/gimmingi/Library/Android/sdk/platforms/android-31/android.jar' which doesn't exist.
Reason: An input file was expected to be present but it doesn't exist.
Possible solutions:
1. Make sure the file exists before the task is called.
2. Make sure that the task which produces the file is declared as an input.
Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#input_file_does_not_exist for more details about this problem.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Exception: Gradle task assemble Debug failed with exit code 1
Exited
Flutter default project should work in Android emulator.
Please check following items
As your build is trying to access android version 31 here android-31/android.jar. Check if android 31 is installed on your machine.
Check the compileSdkVersion and targetSdkVersion in your android/app/build.gradle file.
android {
...
compileSdkVersion 31
defaultConfig{
...
targetSdkVersion 31
...
}
}
Then you can either download the version 31 or change your sdk versions matching your installed sdk versions.
Related
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)
Disclaimer
i got this issue when i had android studio installed, i've been using android studio for a while before i got this issue. and i'm trying to uninstalling android studio to save some of my storage and manually install android emulator, still facing the same issue.
Description
my flutter app scan keystore in the wrong directory when try to run in android emulator, my app keystore located at
/Users/saidulumam/Documents/Projects/flutter/tome/android/~/Library/Android/Sdk/.android/debug.keystore
but it scans
/Users/saidulumam/Documents/Projects/flutter/tome/android/app/~/Library/Android/Sdk/.android/debug.keystore
Steps to Reproduce
go to project folder
type flutter create app_name in this case im using name tome
type cd tome
type flutter run
error
Screenshot
my directory
Logs
Error result :
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:packageDebug' (type 'PackageApplication').
> File '/Users/saidulumam/Documents/Projects/flutter/tome/android/app/~/Library/Android/Sdk/.android/debug.keystore' specified for property 'signingConfig.signingConfigData.storeFile' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 32s
Running Gradle task 'assembleDebug'... 33.9s
Exception: Gradle task assembleDebug failed with exit code 1
flutter doctor :
➜ tome flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.0, on macOS 12.2.1 21D62 darwin-arm, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
✗ 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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[✓] VS Code (version 1.64.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability
! Doctor found issues in 3 categories.
try this command for specifying android sdk path to flutter :
flutter config --android-sdk <path-to-your-android-sdk-path>
I use flutter to make my cross platform app the experience is so smooth and it will work above my expectations but after update flutter to 2.8.1 it throw error like I mention below is that error occurs because of my code or there is flutter issue please let me know in comment
Here is my flutter doctor:-
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.5.2 20G95 darwin-x64, locale
en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.2)
[✓] VS Code (version 1.59.1)
[✓] Connected device (2 available)
! Error: iPad is busy: Waiting for Device. Xcode will continue when iPad is
finished. (code -10)
! Error: iPhone 7 is not connected. Xcode will continue when iPhone 7 is
connected. (code -13)
• No issues found!
Here is eroor log:-
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No version of NDK matched the requested version 21.0.6113669. Versions available locally: 23.1.7779620
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 40s
Exception: Gradle task assembleDebug failed with exit code 1
I think your flutter version can't find ndk in your directory
here is some steps to set ndk in your project
download ndk side by side from sdk manager
Add Ndk path to your local.properties file in android-> local.properties Like this:-
ndk.dir=/Users/imac/Library/Android/sdk/ndk/23.1.7779620
Add ndkVersion in your app build.gradle file in android->app->build.gradle Like this:-
android {
compileSdkVersion 31
ndkVersion '23.1.7779620'
}
I've been trying to run my Flutter app in VScode, but the following message appears:
Microsoft Windows [versão 10.0.19042.928]
(c) Microsoft Corporation. Todos os direitos reservados.
C:\projects\tests\fluttertest>flutter run
Launching lib\main.dart on Google Nexus 7 in debug mode...
Checking the license for package Android SDK Build-Tools 29.0.2 in C:\Users\sophi\AppData\Local\Android\sdk\licenses
Warning: License for package Android SDK Build-Tools 29.0.2 not accepted.
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: C:\Users\sophi\AppData\Local\Android\sdk
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 16s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 17,2s
Exception: Gradle task assembleDebug failed with exit code 1
Also, when I run the flutter doctor in prompt it returns the following message
C:\src\flutter>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [versão 10.0.19042.928], locale pt-BR)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.55.2)
[√] Connected device (3 available)
! Doctor found issues in 1 category.
C:\src\flutter>flutter doctor --android-license
Could not find an option named "android-license".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
C:\src\flutter>flutter doctor --android-licenses
Warning: File C:\Users\sophi\.android\repositories.cfg could not be loaded.
7 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)?
I've looked for my repositories.cfg file and it doesn't exist.
Go to SDK Manager and download android 10(if using android studio)
Make sure to download JDK Version 1.8
Run flutter doctor --android-licenses in the terminal
Run : Flutter doctor --andriod-licenses...
Then rund your code back
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