Flutter Attach in Android Studio not working - iphone

I develop flutter app using the "add-to-app" mode. I tried to use Android Studio to attach to the iPhone Simulator. But when I click the "Flutter Attach" button, there is no response at all and no output on the console.
I can successfully use terminal flutter attach to attach.
macOS 12.5.1
Android Studio version:
Android Studio Chipmunk | 2021.2.1 Patch 1
Build #AI-212.5712.43.2112.8609683, built on May 19, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 10
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: Dart (212.5744), org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46), io.flutter (70.0.2)
How can I find the flutter attach error log in Android Studio? Appreciate if you can provide any means to solve this problem.

This is a bug of Android Studio. Downloaded a archived version of AS solved this problem:
Android Studio Arctic Fox | 2020.3.1 Patch 2
Build #AI-203.7717.56.2031.7678000, built on August 27, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.6
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 10
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: Dart, io.flutter

Related

dart sdk is not configured in macos

I already have dart sdk installed:
running dart --version gives me:
Dart SDK version: 2.17.6 (stable) (Tue Jul 12 12:54:37 2022 +0200) on "macos_arm64"
up until now I was using vscode but now I need to go back to android studio which gives me the following error on top of every dart file:
Dart sdk is not configured
N.B: This is not a fresh install. I have been using flutter and vscode in my mac for quite some time now
Try this in your Android Studio.
Preference
plugin
search for flutter from the market
install flutter and also make sure dart is install, you can confirm by searching for dart also.
restart you android studio after and you should be fine

Flutter doctor is not detecting visual studio

I just installed flutter SDK on my windows pc and then I ran flutter doctor and I got this.
[✓] Flutter (Channel stable, 3.0.3, on Microsoft Windows [版本 10.0.22000.739], locale zh-TW)
[✗] Visual Studio - develop for Windows
✗ Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[✓] VS Code (version 1.68.1)
[✓] Connected device (1 available)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
But I already got visual studio 2022 installed with "Desktop development with C++" on my pc.
What I have tried:
Switch the channel to Master
Install visual studio 2019 with "Desktop development with C++"
Restarting the PC
Reinstall visual studio 2022 with "Desktop development with C++"
I was in the same situation as you.
I solved the problem by bringing vswhere up to date.
In my environment, the following paths are affected.
C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
Here is the URL I used for reference
https://github.com/microsoft/vswhere/releases
https://github.com/flutter/flutter/issues/102451

Flutter Error when trying to debug Windows App

I am trying to start Windows app for first time with default Flutter Project but it's showing this error espacialy.
Unable to start engine without AOT data.
Failed to create view controller.
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
Error launching application on Windows.
Exited (sigterm)
Here is my flutter doctor -v results:
[√] Flutter (Channel stable, 2.10.0, on Microsoft Windows [Version
10.0.19042.1526], locale tr-TR)
• Flutter version 2.10.0 at D:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5f105a6ca7 (2 weeks ago), 2022-02-01 14:15:42 -0800
• Engine revision 776efd2034
• Dart version 2.16.0
• DevTools version 2.9.2
[√] Android toolchain - develop for Android devices (Android SDK version
31.0.0)
• Android SDK at D:\sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = C:\Users\pc\AppData\Local\Android\Sdk
• Java binary at: D:\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[X] Chrome - develop for the web (Cannot find Chrome executable at
.\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.1.32210.238
• Windows 10 SDK version 10.0.22000.0
[√] Android Studio (version 2020.3)
• Android Studio at D:\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 11.0.10+0-b96-7249189)
[√] Connected device (2 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API
30) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.1526]
[√] HTTP Host Availability
I tried flutter clean but it is not working. What can I do for this error?
I have fixed this issue from aceta-minophen on github
(https://github.com/flutter/flutter/issues/97086#issuecomment-1029963716)
aceta-minophen solution:
Found the app.so file in ..\build\windows
Copied the file and pasted it in ..\build\windows\runner\Debug\data
[UPDATE]
upgrading flutter to the last version should fix this:
RUN:
flutter upgrade
It seems that problem with this version of Visual Studio
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.1.32210.238
• Windows 10 SDK version 10.0.22000.0
Try to unintall Visual Studio Community 2022 and install Visual Studio Community 2019
With Visual Studio 2019 all works like a charm :)
I was getting some AOT error wile launching the windows app from vs code , so i downgraded visual studio 2022 to visual studio 2019 and it was working for me
A workaround that also allowed debugging:
edit <proj_dir>\windows\flutter\CMakeLists.txt to replace $<CONFIG> with Debug
There was a single occurrence, near the end of add_custom_command.
This was needed after upgrading VS 2022 to 17.1.0 (it worked fine with 17.0.6).
Windows support for the project was initially added with flutter create --platforms=windows .
VS bug: CMake->vcxproj regression in 17.1.0 when using $ in custom command.
Flutter 2.10.3 resolves this issue.
I stated a fix for the issue on the video here it was simply the app.so being in the wrong folder,
You can watch the video here with full details
Steps to Reproduce
Create a new application.
run flutter run -d windows --debug
Expected results: The build should success.
Actual results: Can't load AOT data from C:\Users\nieti\Desktop\flutter_application_1\build\windows\runner\Debug\data\app.so; no such file. Unable to start engine without AOT data. Failed to create view controller. Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. Error launching application on Windows.
Logs
Did you manage to solve your issue? Im facing this exact issue but flutter doctor shows that everything is OK and Windows is listed on Connected Devices. Im on Flutter 2.10
Hey! I faced the same issue today and I solved this by doing the following:
Found the app.so file in ..\build\windows
Copied the file and pasted it in ..\build\windows\runner\Debug\data
This is a good workaround:
https://stackoverflow.com/a/71216391/9948598
I need to restore CMakeLists.txt to his original state before build for release, but the modified version let me work in debug mode.
I have another solution instead of uninstalling visual Studio 2022 version just modify the the settings inside installer and install the latest version of windows sdk i.e. win sdk 10(10.0.20348.0) and that will solve the problem of app.so hence the AOTdata not found problem

Android Studio third dependencies package import intellisense did not work

Today I am facing a problem that the third party dependencies package import intellisense did not work. This is a simple code, I am using get in flutter like this:
class WordProvider extends GetConnect {
}
this is the part of the dependencies define in my project:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
get: 4.3.8
as expect, the android studio should give me tips should import the package:get/get.dart after the mouse hang over the GetConnect, but it not give any import suggestion. I have tried:
File-> Ivalidate caches / Restart -> Invalidate and Restart
still did not work. This is my env information:
[dolphin#MiWiFi-R4CM-srv]~/Documents/GitHub/reddwarf-dict% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.2, on Fedora 32 (Workstation Edition) 5.11.22-100.fc32.x86_64, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
✗ Android SDK file not found: /home/dolphin/Android/Sdk/platforms/android-31/android.jar.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2)
[✓] VS Code (version 1.60.2)
[✓] Connected device (2 available)
! Doctor found issues in 1 category
why would this happen and what should I do to fix it? This is android studio version info:
Android Studio Arctic Fox | 2020.3.1 Patch 2
Build #AI-203.7717.56.2031.7678000, built on August 26, 2021
Runtime version: 11.0.10+0-b96-7249189 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.11.22-100.fc32.x86_64
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 16
Registry: ide.instant.shutdown=false, external.system.auto.import.disabled=true
Non-Bundled Plugins: com.bakerj.flutter.fishreduxtemplate.id, com.bloc.intellij_generator_plugin, com.intellij.marketplace, Dart, com.thoughtworks.gauge, org.jetbrains.kotlin, io.flutter, org.intellij.plugins.markdown
Current Desktop: GNOME
Remove the dependency and run flutter clean and after that run:
flutter pub add get

Android Studio hang when starting emulator

Android emulator can not boot and also
Android Studio is hanged when starting emulator.
My OSX version is Big Sur 11.0 Beta and Android Studio version 4.0.1.
Does anyone have experience in?