Unignore Ionic Doctor Issue - ionic-framework

I accidentally hit “Ignore forever” in an ionic doctor issue.
Is there any option to re-enable this issue? I looked in the projects config files but didn't find any changes. I also uninstalled / installed ionic but the issue is still ignored.

It seems to be setting an ignored array in config.json file in .ionic folder or app configuration folder present in home directory. It may be that it is not a project level setting but cli config level.
"state": {
"lastCommand": "date-stamp",
"doctor": {
"ignored": [
"app-scripts-update-available",
"ionic-native-update-available"
]
}
Deleting the contents of the array seems to show the ignored issues when doing ionic doctor check.

Related

fvm version as default in VSCode not working

I added fvm to my project and set it up like this. Now I can run all the commands for example fvm use x.x.x or fvm flutter pub get. Everything works.
BUT when running the application through VSCode directly (Play button or shortcut) it always uses my latest install SDK version. Why is it not starting with the current flutter version ?
This is my settings.json:
{
"dart.flutterSdkPaths": [
"/Users/usr/fvm/versions"
],
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
}
}
What am I missing here? How do I configure fvm to work correctly with VSCode?
I'm assuming you have the .fvm folder set up properly? ie. It contains the symlink flutter_sdk (which points to the currently selected SDK) and the fvm_config.json.
In your settings.json file, you also need to set the location of the SDK itself:
"dart.flutterSdkPath": ".fvm/flutter_sdk",
Which will point to the same symlink.

Flutter Gradle task assembleDebug failed with exit code 1 zip END header not found

Hello I am new to Flutter I have setup flutter with android studio 4.2.1, and every thing is fine. When I try to run it; it show me following error
I see too much questions but it is not helpfull for me
flutter doctor run no issue found
Hers is doctor result
Here is my enviroment variable
can any one guide me how can I run the flutter. I am lunching it in a chrome
exception in thread "main" java.util.zip.ZipException: zip END header not found at
java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1567) at
java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1462) at
java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1469) at
java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1274) at
java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237) at
java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:727)
at
java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844)
at java.base/java.util.zip.ZipFile.(ZipFile.java:247) at
java.base/java.util.zip.ZipFile.(ZipFile.java:177) at
java.base/java.util.zip.ZipFile.(ZipFile.java:191) at
org.gradle.wrapper.Install.unzip(Install.java:214) at
org.gradle.wrapper.Install.access$600(Install.java:27) at
org.gradle.wrapper.Install$1.call(Install.java:74) at
org.gradle.wrapper.Install$1.call(Install.java:48) at
org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48) at
org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at
org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Exception: Gradle task assembleDebug failed with exit code 1
I recently Solved this problem.
This Problem came from gradle file is corrupted in my system.
I'm using Linux so this steps almost same in windows also. This answer is for any gradle version.
Open File Manager:
enable Show hidden folder from top menu bar.
You may find this location : .gradle>wrapper>dists.
In Linux: Home > .gradle > wrapper > dists.
In Windows: C:>Users>{PC Name}>.gradle>wrapper>dists
Method 1
Go inside gradle-6.5-all > dists > 2oz4ud9k3tuxjg84bbf55q0tn. '2oz4ud9k3tuxjg84bbf55q0tn' may be different in your PC.
Delete all files in that folder and download required file manually: https://downloads.gradle-dn.com/distributions/gradle-6.5-all.zip
after download paste freshly downloaded zip file in that folder.
Run your project flutter run -v
Method 2
Try this if you have fast & stable internet connection.
Delete that gradle-6.5-all folder.
Open project in VS code or Android Studio and open terminal.
Run this command flutter run -v
Method 3
Flutter Doctor will give right result.
Open Android Studio
Create new flutter project
Click on Tools > flutter >Flutter for editing in android studio
and wait, flutter doctor takes time to identify problem.
Use this link for download gradle file.
Replace 6.5 with your gradle version.
https://downloads.gradle-dn.com/distributions/gradle-6.5-all.zip
I hope this answer helpful for you.
Please use the below command
1.Mac User :
rm -rf ~/.gradle
2.Windows User :
remove the .gradle file
.gradle file location -> C:\Users\myUser
I solve this error by updating the gradle plugin/version. I have as part of my configuration:
Windows 10
Android Studio 4.2.1
Java 11: Android Studio 4.2.1 don't have support for JDK 16, so, I installed JDK 11, and configured the AS (how to change the jdk in AS) to use this older JDK
Gradle 7.0.1
By default, when you create a new Flutter project, the IDE created it with basic standard configurations, so you have to change this configs to fit your current config. For that, you need to update the gradle config in the flutter project, as follow:
in android/gradle/build.gradle file: update the gradle plugin to 4.2.0 in the dependencies section, like this:
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
//more dependencies
}
in android/gradle/wrapper/gradle-wrapper.properties file: update the gradle version, in this case I have the 7.0.1, feel free to use another one, like this
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-all.zip
//more attributes
After you change the gradle config, run this commands in your project:
flutter clean : clean the project
flutter pub get : update your dependencies
flutter run : run the project. Now it must work, at least it work for me
I faced the same problem in VSCode when I wanted to run the Flutter app I got that error, so after lots of debugging and research, I found the solution. it's pretty easy, just follow these steps:
In windows 10:
1. Open flutter project in a Text-Editor like VSCode.
2. Open android -> gradle -> wrapper -> gradle-wrapper.properties
3. You will find "gradle-6.7.1.all.zip" inside gradle-wrapper folder
4. Go to this path: C:\Users\your-user
5. Then go to the wrapper->dists and find "gradle-6.7.1.all" folder
5. Delete this folder.
6. Then come to VSCode and open Terminal.
7. Please make sure that you have stable internet connection then type this command in terminal
8. flutter run
I hope this solution can help you!
I solve this error by deleting the .gradle folder.
This location is gradle folder
In Windows: C:> Users> {PC Name}>. Gradle
After deleting this folder, you only need to run the application again in Android Studio. At this point, Android Studio starts downloading the deleted folder automatically.
enter image description here
This error is caused by corrupted gradle files, this is either due to incomplete downloads due to network issues. To solve it easily download the gradle zipped file from https://downloads.gradle-dn.com/distributions/gradle-6.7-all.zip and paste on the .gradle directory as shown below if you are on linux
enter image description here
I try all method but it did not work for me so i decided to location the gradle-wrapper.properties in the andriod folder then i change the distribution gradle link to a more recent gradle link.
Welcome SO.
Java 16/latest version is not fully compatible with the Gradle 6 at this moment. Try to use java 11 or 8, it will resolve your issue.

Flutter Windows: cannot build App error MSB8066

I am getting this error while building for windows
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'D:\DSI projects\sanjali_app\build\windows\CMakeFiles\a6c8cc86bdf940a07f4885a881770ba0\flutter_windows.dll.rule;D:\DSI projects\sanjali_app\build\windows\CMakeFiles\9c479cc21d461e620769ab96f5bca778\flutter_assemble.rule' exited with code 1. [D:\DSI projects\sanjali_app\build\windows\flutter\flutter_assemble.vcxproj]
Exception: Build process failed.
Updated Aug 2021
Faced the same error for couple of hours, and none of the issue on Github or answer on StackOverflow seems to be working for me.
So after my research I found out that there is no specific reason why Error MSB8066 error occur, but it can be due to space in your project Folder path as mentioned by #aishamhasan or some other undetermined reason. In my case, there is a simple file that is missing.
Error detected in pubspec.yaml:
[ +2 ms] [ ] No file or variants found for asset: images/project_app.png.
In order to quickly find out what causing this problem, you can run your project from the command line instead of using run functionality on android studio.
flutter run -d windows -v
And inside your verbose, lookout for any error, or you can directly search for Error and then try to figure out what was causing the error.
Followed the same approach and I was able to resolve the error very quickly.
Sometimes I get this error too. I have found that it happens whenever I forget to add a final slash "/" when declaring an assets folder in pubspec.yaml. For example:
This will produce the error:
flutter:
assets:
- assets/
- assets/game_logos
Adding the final slash solves the error:
flutter:
assets:
- assets/
- assets/game_logos/
The solution that worked for me is that I deleted build folder/dir from my project
In my case I had an assets image that I removed from the folder but had the path in pubspec.yaml, so I deleted the path then the app could run in Windows.
Removing spaces on the Projects Folder Path Solves the Issue.
Flutter Issues
I got MSB8066 when I generate python bindings, and fixed this by disabling
BUILD_PYTHON_BINDINGS in CMakeLists.txt
This can happen for a few reasons, an asset's path is missing the slash:
So:
assets:
assets/image
While it should be like this:
assets:
assets/image/
With the slash at the end.
The other more normal one, and which could really be causing such an error, could be the following;
The directory your project is in contains a special character, for example:
C:\Users\Aurélio Fernam\Documents\Projets\my_project
As you can see, "Aurélio" contains a special character. This could be causing this error.
Also try not to have a folder with space in your project path, like this:
C:\Users\Aurélio Fernam\Documents\Projets\my_project
Notice that "Aurélio Fernando/" besides having a special character, contains a space.
This could also be a trigger.
After having moved the project to a better directory, run flutter clean and run the project normally.
I faced the same issue due to some errors were there in some of the dart files. Check for red-underlined errors in the dart files you may have missed. These errors don't allow the project to run. After resolving the errors the project is running fine.
Non-Alphanumeric Characters in the project name also cause it.
I played arround with json in my asset folder. I deleted it and missed to remove it from pubspec as well.
Deleting the build folder in my project fixed the issue for me, you can also run a flutter clean, then run your project again.
In my case I use:
flutter pub get
None of the above methods worked for me.
First, I get an export zip file from project. And extract its content.
And open it, instead of the main project.
Only this worked for me after 1 day. But don't know why!
UPDATE:
This error fix for me when run Android Studio as administrator.

Could not resolve project :url_launcher_macos

I create new app in flutter and it's work when I run it, but when I add shared_preferences package, I got this error when I run it
Could not determine the dependencies of task ':url_launcher:compileDebugAidl'.
Could not resolve all task dependencies for configuration ':url_launcher:debugCompileClasspath'.
Could not resolve project :url_launcher_macos.
Required by:
project :url_launcher
Unable to find a matching configuration of project :url_launcher_macos:
- None of the consumable configurations have attributes.
Neither package is compatible with mac
I have faced the same problem and i have fixed this with running following command:
flutter pub cache repair
If this is not working then please try the following:
flutter channel stable then run the commands
flutter clean and flutter upgrade
This worked for me
NOTE:- CLOSE THE FLUTTER PROJECT
Go to Flutter sdk path
Enable the view hidden files in Mac by using CTRL + SHIFT + .
Go to .pub-cache
Go to hosted
Go to pub.dartlang.org
delete this folder url_launcher_macos
Open the project and run app

Flutter Gradle build with error exception

i just setup my android studio and vs code and flutter SDK installed but any time i try running the project i get this Gradle error, i cant figure out what the problem is please help me out.
After running the flutter doctor everything seems to be okay.
the problem might be caused by many factors so lets try some solutions
after each one rebuild your app if the error message changed or the problem solved please keep us informed
run these commands one by one
flutter channel stable
flutter upgrade --force
flutter pub cache repair
cd your app folder
flutter clean
edit app/build.gradle in your host app such as it includes the local repo
like in here
repositories {
maven {
url 'https://storage.googleapis.com/download.flutter.io'
}
}
use VPN and rebuild your app