Flutter Secure Storage not working after build in release mode - android-studio

Everything works fine in debug mode and release on emulator, but reading values from FlutterSecureStorage fails on a physical device. Other functionalities in application work properly, when I comment using FlutterSecureStorage.
After installing .apk file and launching application on a device, it uses FlutterSecureStorage to get information if user is logged in or not, along with other values. I expect null during first run, of course, but storage.read(key) seams to fail before returning any value.
Added backup tags in main/AndroidManifest.xml
<application
...
android:allowBackup="false"
android:fullBackupContent="false">
Added deleting keys on startup
final FlutterSecureStorage storage = FlutterSecureStorage();
Future<void> checkIfUserIsSignedIn() async {
storage.deleteAll();
try{
isUserSignedIn = await storage.read(key: _isLoggedIn);
}
catch (e){
print(e);
}
setState(() {});
}
Tried with FlutterSecureStorage v.3.3.3 and FlutterSecureStorage v.3.2.0, but there was no change.
I checked SDK version of my device (Honor 10) - 29. Also checked on other device (Samsung Galaxy S9+), but the issue also occurs.
Running flutter run --release causes warnings:
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\karo\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_secure_storage-3.2.0\android\src\main\java\com\it_nomads\fluttersecurestorage\FlutterSecureStoragePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
and error:
Installing build\app\outputs\flutter-apk\app.apk... 376ms
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install C:\Users\karo\idom_mobile\build\app\outputs\flutter-apk\app.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.project.idom signatures do not match previously installed version; ignoring!]
Uninstalling old version...
Installing build\app\outputs\flutter-apk\app.apk... 6.9s
but successfully installs application on emulator and everything works as expected.
The problem is when I install application on physical device. To generate .apk I use flutter build apk --release and install using app-release.apk file as stated in build log:
flutter build apk --release
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 69.9s
√ Built build\app\outputs\flutter-apk\app-release.apk (48.9MB).
My flutter doctor -v
flutter doctor -v
[√] Flutter (Channel dev, 1.24.0-10.2.pre, on Microsoft Windows [Version 10.0.18362.1198], locale en-GB)
• Flutter version 1.24.0-10.2.pre at C:\Users\karo\flutter
• Framework revision 022b333a08 (27 hours ago), 2020-11-18 11:35:09 -0800
• Engine revision 07c1eed46b
• Dart version 2.12.0 (build 2.12.0-29.10.beta)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\karo\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] Connected device (1 available)
• Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64 • Android 10 (API 29) (emulator)
• No issues found!
I tried to make sure my project is migrated to AndroidX and got a message: No Usages Found in the Project.
I don't have any more ideas, could you help me?
EDIT
I tried using SharedPreferences as a temporary workaround, but it still didn't work - as I guess, the package was not initialized.
I built my app with flutter build apk --release --no-shrink after reading this thread https://github.com/flutter/flutter/issues/65334.
Then tried flutter build apk --release --no-shrink with the version of my application that uses FlutterSecureStorage and it worked.
Should I really consider it as a valid fix and always build my application this way?

How are you initializing the package? The issue seems to occur while the app runs in the background, A workaround posted in this thread is by registering the plugins on Android's MainActivity - this adds FlutterSecureStoragePlugin.
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
}

You can fix this like I did
Check in pubspec.yml
environment:
sdk: ">=2.16.2 <3.0.0"
and
flutter_secure_storage: ^4.2.1
Check in android/app/build.gradle
compileSdkVersion 32

did you add the permission to your manifest file?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

Related

Flutter Hot Restart and Hot Reload button greyed out

I decided to learn flutter so i downloaded the plugin in Android studio. I followed the docs at Flutter's website in order to run the Hello World program. The project builds without errors and runs but it never gets past
Installing build\app\outputs\flutter-apk\app.apk...
While at this point, the screen goes white and stays that way.
If I stop the process in Android studio and quit the app on my phone (Nokia 3.1plus, Android 9), then open the app manually on my phone, it loads up properly.
What I notice is that sometimes it stays stuck at Running Gradle task 'assembleDebug'... while the screen stays white. At this point, it would have outputed
✓ Built build\app\outputs\flutter-apk\app-debug.apk.
I have tried with an emulator and it is the same. I have tried with VSCode and it is the same.
When I run "flutter run" in Command Line, It run the app on my phone without the white screen issue but I cannot use "r" or "R" for hot refresh or restart.
In VS Code debugger console, when I try to run r or R while the Running Gradle task 'assembleDebug'... is still running, it says
global evaluation requires a thread to have been loaded
This is the result of flutter doctor
[√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18363.900], locale en-GB)
• Flutter version 1.20.2 at C:\flutter
• Framework revision bbfbf1770c (4 days ago), 2020-08-13 08:33:09 -0700
• Engine revision 9d5b21729f
• Dart version 2.9.1
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\ADMIN\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code, 64-bit edition (version 1.47.3)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.13.2
[√] Connected device (1 available)
• Nokia 3 1 Plus (mobile) • ROOGALB8C2201609 • android-arm64 • Android 9 (API 28)
• No issues found!
What I have tried
flutter clean, invalidate cache and restart, changing my target sdk to 29, updating flutter and dart
I have tried most of the suggestions on the flutter github issues section.
Is there anything I am missing?
After weeks of prowling the internet, I decided to do a full reset. I uninstalled Android Studio, deleted flutter completely from regular directory as well as all associated PATH and ENVIRONMENT variable, removed all traces of dart too. I also deleted all gradle, sdk and android files from C:/ directory
Basically started afresh. Worked like a charm.
Apparently something got broken
Open the File menu and click Invalidate cache/ Restart. This solved for me !
I had the same problem however, I closed out all open projects and vscode, returned to open vscode with a prompt to install recommended vscode settings for Dart, Run the code without debugging and everything worked fine.
Closed VsCode with project
Opened VsCode again (system automatically prompted me to use VsCode recommended settings) to install VsCode recommended settings
Run from the menu without debugging.
That solved the problem for me.

Issues with Google Maps enabled App using flutter framework on Android Studio

Trying to build a cross platform connected device Google Maps enabled App using flutter framework on Android Studio without success. The flutter run works seemlessly until device dependency google_maps_flutter: is used under pubspec.yaml. AndroidX is enabled in the gradle. So far trying only on the emulators.
The warning message furnished below seems appropriate, but the steps given in the link are difficult to realize. Build keeps on searching for version 5.4.1. The gradle wrapper is configured for gradle-4.10.2 and the gradle as com.android.tools.build:gradle:3.2.1. The Android version and SDK toolchains are up-to-date. Need help here.
The terminal warning message:
The plugin `flutter_plugin_android_lifecycle` is built using an older version of the Android
plugin API which assumes that it's running in a full-Flutter environment. It may have undefined
behaviors when Flutter is integrated into an existing app as a module.The plugin can be
updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
More error messages:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':flutter_plugin_android_lifecycle'.
> Could not resolve all artifacts for configuration ':flutter_plugin_android_lifecycle:classpath'.
> Could not find com.android.tools.build:gradle:5.4.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.4.1/gradle-5.4.1.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.4.1/gradle-5.4.1.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.4.1/gradle-5.4.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.4.1/gradle-5.4.1.jar
Required by:
project :flutter_plugin_android_lifecycle
flutter doctor -v
[√] Flutter (Channel master, v1.15.4-pre.134, on Microsoft Windows [Version 10.0.18362.657], locale en-US)
• Flutter version 1.15.4-pre.134 at C:\Users\Encoded\flutter
• Framework revision bf8e2c1449 (2 days ago), 2020-02-21 14:21:25 -0800
• Engine revision f2f8c342be
• Dart version 2.8.0 (build 2.8.0-dev.9.0 0f141be8bd)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\Encoded\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: D:\Apps\AndroidStudio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at D:\Apps\AndroidStudio
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!
Edited: Here's the contents of pubspec.yaml
name: google_maps_for_flutter
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
shared_preferences: ^0.5.3+1
http: ^0.12.0+2
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
google_maps_flutter:
flutter:
uses-material-design: true
assets:
- assets/maps_style.json
module:
androidX: true
Edited pubspec.yaml as per the comment of Ovidiu like so
dependencies:
flutter:
sdk: flutter
google_maps_flutter: ^0.0.3+3
The following errors are yet generated:
"Install Android SDK Platform 27 (revision: 3)" finished.
Path not found - D:\Android_Projects\GoogleMapsFlutter\google_maps_for_flutter_starter\android\app\${assetsDirectory}
D:\Android_Projects\GoogleMapsFlutter\google_maps_for_flutter_starter\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:4: error: package io.flutter.plugins.flutter_plugin_android_lifecycle does not exist
import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin;
^
D:\Android_Projects\GoogleMapsFlutter\google_maps_for_flutter_starter\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:16: error: cannot find symbol
FlutterAndroidLifecyclePlugin.registerWith(registry.registrarFor("io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin"));
^
symbol: variable FlutterAndroidLifecyclePlugin
location: class GeneratedPluginRegistrant
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
To pass this error, add below line to app/proguard-rules.pro
-keep class androidx.lifecycle.** { *; }
And add bellow line to app/build.gradle
lintOptions {
checkReleaseBuilds false
}

Gradle failures following update of android studio to version 3.4

I've updated Android studio today and my flutter project is no longer working. Gradle is failing with the following message:
* Error running Gradle:
ProcessException: Process "C:\Projects\firebase_setup_app\android\gradlew.bat" exited abnormally:
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
*********************************************************
WARNING: This version of firebase_auth will break your Android build if it or its dependencies aren't compatible with AndroidX.
See https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
Command: C:\Projects\firebase_setup_app\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
I've tried making a new flutter project in the latest version of studio and this builds OK.
The issue seems to be around the fact I'm using google play services and firebase in my project. I updated google services to the latest (4.2.0) and gradle to 3.4.0 following a prompt from the IDE
I updated the compiledSDKVersion from 27 to 28 in android/app/build.gradle
I've updated the gradle version in android/gradle/gradle-wrapper.properties from 4.10.2 to 5.1.1 as there was an incompatibility and I was prompted to update.
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
I've done the refactor>migrate to AndroidX... and included:
android.useAndroidX=true
android.enableJetifier=true
in the gradle.properties file
I've tried clearing the cache via 'File>Invalidate Caches and restart...'
I have tried flutter clean and flutter doctor -v with no issues shown:
C:\Projects\firebase_setup_app>flutter clean
Deleting 'build\'.
Deleting 'C:\Projects\firebase_setup_app\.dart_tool\'.
C:\Projects\firebase_setup_app>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 6.3.9600], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[√] IntelliJ IDEA Community Edition (version 2018.3)
[√] Connected device (1 available)
• No issues found!
C:\Projects\firebase_setup_app>flutter doctor -v
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 6.3.9600], locale en-GB)
• Flutter version 1.2.1 at C:\src\flutter\flutter_windows_v1.0.0-stable\flutter
• Framework revision 8661d8aecd (10 weeks ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390fa4
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[√] Android Studio (version 3.4)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 34.0.2
• Dart plugin version 183.5901
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[√] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.3
• Flutter plugin version 31.3.4
• Dart plugin version 183.5153.38
[√] Connected device (1 available)
• SM G930F • ce0616069dbace2f03 • android-arm64 • Android 8.0.0 (API 26)
• No issues found!
I've also updated the android/build.gradle dependencies:
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
//classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
The android/app/build.gradle dependencies are as follows:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
my pubspec.yaml includes the following plugins:
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
google_sign_in: ^4.0.1+3
firebase_auth: ^0.8.4+5
firebase_core: ^0.3.4
#firebase_core: any
firebase_database: ^2.0.3
Any suggestions please to resolve greatly appreciated!
I think your problem is with androidX[as I have seen in the error] and also for the fact that you are using firebase_auth: ^0.8.4+5.
1.use the latest version of android studio
open your flutter project in android studio, go to Refactor,select Migrate to androidX.
when prompted to with a window open the window in a new tab[open in a new android studio window], this will open your android app folder in this window select migrate to android X again.
when the process is done navigate to the bottom and select refactor.
lunch your app again
hope this helps
check this out: https://medium.com/#swhussain110/how-to-migrate-your-flutter-app-to-androidx-9a78eaaa924b

When I run flutter build IOS gets stuck in the middle of process

Whenever I run flutter build IOS, it seems to work fine, however when it gets to the point of "Building Dart Code", it just gets stuck there forever.
I was however been able to run flutter build apk successfully before this.
This is the flutter doctor -v output:
[✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.13.6 17G65, locale en-GB)
• Flutter version 0.11.3 at /Users/../flutter
• Framework revision 72bf075e8d (4 days ago), 2018-11-09 20:36:17 -0800
• Engine revision 5646e86a6f
• Dart version 2.1.0 (build 2.1.0-dev.9.3 9c07fb64c4)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/../Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.0, Build version 10A255
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 30.0.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[!] Android Studio
• Android Studio at /Applications/Android/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ Android Studio not found at /Applications/Android/Contents
• Try updating or re-installing Android Studio.
[✓] VS Code (version 1.24.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.20.0
[✓] Connected device (1 available)
• .. iPhone • 77afb908fc6c490d3fca62cdde9a74ab4e45b4f0 • ios • iOS 11.4.1
! Doctor found issues in 1 category.
I will also post where exactly gets stuck:
-MacBook-Pro:flutterLoginApp-master4OK ..$ flutter build ios
Building Login for device (ios-release)... Automatically signing iOS for device deployment using specified development team in Xcode project: ...
Starting Xcode build... ├─Building Dart code... 1.6s //and just gets stuck here forever ...
Current beta version(0.11.3) is not working and gets stuck when building the release version on ios.
The fix for now is downgrade your flutter version or change to master branch while the beta version is stuck.
You can do this using flutter channel master and then flutter upgrade on your terminal.
I have switched to master channel and run: flutter build ios --release and all started to work fantastically fantastic.
According to the solution posted here, https://github.com/flutter/flutter/issues/24139, you can redirect the output to a file with something like > build.log to fix this issue.
Try flutter run --release > build.log

Flutter Doctor (Incorrectly?) Reporting Android Studio Flutter Plugin Not Installed

When I ran flutter doctor it reports that my Android Studio Flutter and Dart plugins are not installed, even though I have the latest installed - and in fact, I can build and deploy a flutter app to a mobile device from Android Studio. I think either my config somewhere isn't correct or flutter doctor has a bug.
When I run flutter doctor -v I get the following:
d:\Dev\Flutter>flutter doctor -v
[√] Flutter (Channel master, v0.5.8-pre.264, on Microsoft Windows [Version 10.0.17134.165], locale en-AU)
• Flutter version 0.5.8-pre.264 at D:\Dev\Flutter\Flutter
• Framework revision b32c77a012 (12 hours ago), 2018-08-07 17:09:14 -0700
• Engine revision 7f083e54fe
• Dart version 2.0.0-dev.69.5.flutter-b04def964c
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at D:\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• ANDROID_HOME = D:\Android\sdk
• Java binary at: d:\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.
[√] Android Studio
• Android Studio at d:\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• android-studio-dir = d:\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[√] Connected devices (1 available)
• HTC PN071 • HT485W903981 • android-arm • Android 5.0.2 (API 21)
• No issues found!
I am running Windows 10 using Android Studio 3.1.4. I have switched flutter git branch to master. I have tried uninstall and reinstall the plugins but no success so far.
Below is my Android Studio plugin screenshot:
Go to
Settings > languages and frameworks > flutter
And then on the sdk path browse the directory where you have downloaded flutter. And check to see if it works
Since you are not using the conventional C: drive. Make sure you do not have another version of android studio installed on your system. This would lead flutter to detect a different version without the flutter plugin.
If there is no duplicate installed, there may just be residual files (ie: a backup).
This is just a guess but I hope this helps :)
Just in case someone else ran into this issue, it turns out that my channel was on 'stable' (1.22.1), switching to 'dev' solved the problem. This is a issue, will certanily been fixed in future 'stable' releases.
enter image description here
in case mine i have both android studio and intellij idea installed on my system so i uninstalled intellij idea that fixed my problem
This isn't an issue. Just ignore it. I also only use vscode and get this "issue". Maybe it would be good changing that issue to a info or warning because it could unsettle new flutter developers.

Resources