Why it shows parameter not correct on flutter? [duplicate] - 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

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.

flutter: parameter format not correct

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

Problem with Flutter Web. Chrome Beta is uninstalled but still showing up

I am facing a problem with the flutter web initialization. I followed the steps in https://flutter.dev/docs/get-started/web Everything went smooth
flutter channel beta
flutter upgrade
flutter config --enable-web
When I do Flutter Doctor I get
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v1.17.0, on Microsoft Windows [Version 10.0.18363.778], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[X] Chrome - develop for the web (Cannot find chrome executable at C:\Program Files (x86)\Google\Chrome Beta\Application)
! C:\Program Files (x86)\Google\Chrome Beta\Application is not executable.
[√] Android Studio (version 3.6)
[√] VS Code (version 1.44.2)
[√] Connected device (1 available)
! Doctor found issues in 2 categories.
I don't have chrome beta on my PC anymore. I have normal chrome. How to change it. Somebody help me out.
Also, I got found this online as a solution but I don't know what it means.
export CHROME_EXECUTABLE=path/to/chrome
This is not the solution but an alternative method you can try. If you are in the beta channel of flutter you can just type flutter build web that will create a web build in your web folder. You can run it on any other server just like normal web application. If you want to do this to an existing project first run flutter create . then flutter build web.