flutter: parameter format not correct - flutter

I am new to Flutter and today I've been stuck to one problem. I cannot debug my app because it says parameter format not correct
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> Several variant outputs are configured to use the same file name "resources-debug.ap_", filters : MAIN:MAIN
Here's my flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.900], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 3.4)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.46.1)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
I've looked for answers everywhere and they didn't work for my case. Most of the solutions are suggesting to change environment path. This is my path: C:\src\flutter\bin
note: I'm using VSCode
Please help.. thank you!

As I observe your Flutter Doctor, it's already defined that Android toolchain and the Android Studioandroid studio is not configured. So. follow the below steps.
For resolve Android toolchain run the "flutter doctor --android-licenses". And for "Android Studio" resolve please goto Android Studio -> Files -> Settings -> Plugins -> install the Flutter. While installing flutter its also asked for install dart click ok and after installation, it will ask to restart the Android Studio. After restart goes to Flutter terminal and runs Flutter Doctor, Now you have resolved the above issue. The last issue is just ignored because it's just showing that no devices are connected.
And you can run the Flutter in Android Studio in Windows and Mac.

This error occurred because of the app level Gradle.file minSdkVersion property is less than 20 or the targetSdkVersion property is less than 30.
It may work for you. In my case, it works perfectly.
minSdkVersion : 20
targetSdkVersion : 30

run these in your project folder,
flutter channel stable
flutter upgrade --force
flutter pub cache repair
flutter clean
Now try to run

Related

Why it shows parameter not correct on flutter? [duplicate]

I am new to Flutter and today I've been stuck to one problem. I cannot debug my app because it says parameter format not correct
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> Several variant outputs are configured to use the same file name "resources-debug.ap_", filters : MAIN:MAIN
Here's my flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.900], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 3.4)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.46.1)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
I've looked for answers everywhere and they didn't work for my case. Most of the solutions are suggesting to change environment path. This is my path: C:\src\flutter\bin
note: I'm using VSCode
Please help.. thank you!
As I observe your Flutter Doctor, it's already defined that Android toolchain and the Android Studioandroid studio is not configured. So. follow the below steps.
For resolve Android toolchain run the "flutter doctor --android-licenses". And for "Android Studio" resolve please goto Android Studio -> Files -> Settings -> Plugins -> install the Flutter. While installing flutter its also asked for install dart click ok and after installation, it will ask to restart the Android Studio. After restart goes to Flutter terminal and runs Flutter Doctor, Now you have resolved the above issue. The last issue is just ignored because it's just showing that no devices are connected.
And you can run the Flutter in Android Studio in Windows and Mac.
This error occurred because of the app level Gradle.file minSdkVersion property is less than 20 or the targetSdkVersion property is less than 30.
It may work for you. In my case, it works perfectly.
minSdkVersion : 20
targetSdkVersion : 30
run these in your project folder,
flutter channel stable
flutter upgrade --force
flutter pub cache repair
flutter clean
Now try to run

"Unable to locate Android SDK. " while running flutter doctor on windows 10

currently my andoid studio is in location
C:\Android\AndroidStudio
on console
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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/windows#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
[√] Android Studio
[√] Connected device (2 available)
! Doctor found issues in 1 category.
my sdk location is
C:\Users\aditya jain\AppData\Local\Android\Sdk
1>i have installed Android sdk platform tools and Android sdk tools (obsoloete)
2>I only have a Local, Loacallow and Roaming File but not a Platforms file
, as i have seen many youtube videos ..they said to add to path platform file but i can't see any in my appdata folder in users(it is hidden by default).
https://www.youtube.com/watch?v=7GuGlATHYX8&t=195s
3> ran flutter config command for my sdk and got
C:\Users\aditya jain>flutter config --android-sdk flutter config --android-sdk \C:\Users\aditya jain\AppData\Local\Android\Sdk
Setting "android-sdk" value to "flutter".
You may need to restart any open editors for them to read new settings.
C:\Users\aditya jain>
Android SDK cannot be found by flutter
in this que there is an answer
to run
flutter config --android-sdk /path/to/android/sdk
flutter config --android-studio-dir /path/to/android/studio
but i don't know what i should for my sdk location ..i have less reputation so i can't comment there to ask there so here i am posting ques
also tried
C:\Users\aditya jain>flutter config --android-sdk <sdk-"C:\Users\aditya jain\AppData\Local\Android\Sdk">
The syntax of the command is incorrect.
C:\Users\aditya jain>flutter config --android-sdk <sdk-C:\Users\aditya jain\AppData\Local\Android\Sdk>
The syntax of the command is incorrect.
as is suggested in same que ans but getting this given above
(i know my path contain spaces ..i tried to put my android in downloads so that there will be no spaces but there also i get errors as below
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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/windows#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
[!] Android Studio
X android-studio-dir = C:\Android\AndroidStudio
X Android Studio not found at C:\Android\AndroidStudio
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
C:\Users\aditya jain>flutter config --android-studio-dir=C:\Users\aditya jain\Downloads\Android\AndroidStudio
Setting "android-studio-dir" value to "C:\Users\aditya".
You may need to restart any open editors for them to read new settings.
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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/windows#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
[!] Android Studio
X android-studio-dir = C:\Users\aditya
X Android Studio not found at C:\Users\aditya
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
C:\Users\aditya jain>
i can't rename ' aditya jain' folder to 'adityajain'...it takes space....pls help mee.
please help and thanks community!!
If the path name has spaces, you can wrap the path with double quotes. This allows Windows to identify the path as a single String: "C:\Users\aditya jain\Downloads\Android\AndroidStudio"
If you have already configured SDK path for Flutter (flutter config --android-sdk ) and yet not working than...
Install the platform-tools resolves the problem.
Go to the SDK Manager (top-right in the toolbar), then open SDK Tools, then check-mark ✅ Android-SDK Platform-Tools and apply the changes (As shown below).
For me this solution worked.
Enjoy...
Check image

vs code cannot launch android emulator

i was just starting with flutter and i was using android studio before and i have an emulator but now i wanted to start with flutter and tried to run the default flutter project but says no device and when i try to connect to the emulator i have it just keeps loading and says "Failed to launch Pixel 3a API 29: Error: Emulator didn't connect within 60 seconds"
tried a lot to fix it but still the same error.
and by the way when i run flutter doctorit displays
Doctor summary (to see all details, run flutter doctor -v):
1.[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
2.[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
3.[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
4.[✓] Android Studio (version 3.5)
5.[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
thanks in advance.
I have faced this problem before, Try these steps:
Open your android studio, go to avd manager
Now select your emulator, click on dropdown in actions and wipe data
Check whether you have intel x86 emulator accelerator ticked in sdk tools in android studio.
If the problem still persists, you can remove this emulator and install a new one.

I receive this error while trying to run Flutter app : Could not find an option named "devtools-server-address"

I was developing a Flutter app using the stable channel, in Android Studio, now I upgraded Flutter Plugin to 53 and now when I try to run my app I receive this error
Could not find an option named "devtools-server-address".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
Someone suggested using the dev channel, but I need to continue in the stable channel!
Suggestion Link:
Could not find an option named "devtools-server-address". when trying to run flutter app from AndroidStudio
Just found the fix:
$ flutter upgrade
$ flutter clean
Then select Invalidate Caches / Restart from the Android Studio File menu!
Follow the following steps:
Run the command flutter clean from terminal.
Go to File -> Invalidate Cache and Restart -> Invalidate and Restart.
Now try running your app. The issue should disappear.
If the error still persists: Go to File -> Settings -> Language & frameworks -> Flutter.
Check that the sdk path is appropriate as shown in below image:
Check the Dart sdk path too:
This should solve your problem.
Follow the steps:
File -> Invalidate Cache and Restart.
Run flutter clean
Worked For me.
For a little bit more details, you could also run flutter doctor to see what is happening.
In my case, I've recently updated Android Studio to version 4.2 and when I run the command it gives me:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.22.6, on macOS 11.2.2 20D80 darwin-x64, locale en-GI)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[!] Android Studio (version 4.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2020.1.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)
! Doctor found issues in 3 categories.
As well you could run flutter doctor -v as specified to get more details as verbose (where -v stands for verbose)
In my case the plugins where not visible for Android Studio and wasn't using a stable version of Flutter which didn't allow me to enable the plugins, although they were installed.
After this I've switched to a stable version of Flutter, double checked any required updated from Android Studio, uninstall and re-install the plugins and worked like a charm.
Want to mention that flutter clean and flutter pub get were necesarry afterwards.

Flutter and Dart plugin not installed errror when downgrade flutter even though they are installed on android studio

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel unknown, v1.4.0, on Microsoft Windows [Version 10.0.19041.804], locale en-IE)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit
https://flutter.io/setup/#android-setup for detailed
instructions.
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.52.1)
[!] Connected device
! No devices available
I was using the latest version of flutter, ran flutter doctor, everything was fine. I then downgraded flutter now it's saying I don't have the flutter and Dart pluggins installed even though I do.
I ran this command - flutter doctor --android-licenses and received the following error
A newer version of the Android SDK is required. To update, run: C:\Users\willm\AppData\Local\Android\sdk\tools\bin\sdkmanager --update
I then ran the command it told me to run and received this error
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
I have now ran out of ideas, any advice on what to do without upgrading flutter again?
There are some solutions that maybe helpful
1). Solution 1
Run Flutter clean ann rebuild the app
2). Solution 2
Accept Licenses by running following commands
You just have to accept license by running this command
yes | sdkmanager --licenses
for Linux Use:
yes | ~/Android/Sdk/tools/bin/sdkmanager --licenses
for Windows Use:
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
Note: set
%ANDROID_HOME%
as
C:\Users\username\AppData\Local\Android\Sdk
After that check licenses
Flutter:
flutter doctor --android-licenses
3).Solution 3
the current SDK version is incompatible with Java 9.
So, to solve it, you can downgrade your java version to Java 8, or with a workaround, you can export the following option on your terminal:
Linux:
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
Windows:
set JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
And to make it stick, you can export the JAVA_OPTS in your profile file on Linux (.zshrc, .bashrc and etc.) or add as an environment permanently on Windows.
Then, you can type the flutter or sdkmanager command:
Flutter:
flutter doctor --android-licenses
sdkmanager:
sdkmanager --licenses
and type Y when needed to accept the licenses.
so i was experiencing the same issue after upgrading to flutter 2.0, but some packages aren't ready. because of that i had to downgrade. Even though flutter doctor said:
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
I was still able to build and test app without issues. So try rebuilding and running app. hopefully when it's save to upgrade to 2.0 these little things will go.