No devices Android studio and flutter - android-studio

Hi I am trying to run my Flutter project in Android studio. The device list lists "no devices" but when I run "flutter doctor" in the terminal it says 1 device connected.
I think the issue has to do with that the Android sdk is not being found by flutter, and I have to run "set ANDROID_HOME="Android path"" on each startup of the software.

Related

The Android studio recognize my samsung s22 phone but will not run an app via usb debugging

I have recently installed the Android Studio Dolphin | 2021.3.1 Patch 1 on a Fedora Linux OS and when I tried to run my first app on the physical device via USB debugging I noticed that the app will not run on my Samsung S22 device even the Android studio recognize my device and does not throw any error.
So when I click on the run app button the Android studio starts the build process and finishes the same process, but after the build process, the same app will not install and run on my phone.
So what is the problem?
Here is the screenshot:
Here is the screenshot of my SDK manager:

How to run an app on an iPhone simlator with Android Studio on mac?

I want to get started with flutter. I have downloaded flutter and the Android Studio and XCode. In Android Studio, I can select the ios simulator from the drop down menu, but all that does is turn the simulator on and doesn't actually run my app. I am not sure what else do I have to do?
Open your app on Xcode, xcode will configure somethings. When you compile from android studio to an iphone emulator, xcode compiles the project, so it needs to configure the project at least once. You may need to go to the project's ios folder and run pod install to install the ios dependencies.

<Flutter> emulator launched but not detected by android studio

I'm a beginner in Flutter and I've an emulator opened/powered on and android studio doesn't detect it.
Hence I can't run any program because "no device is running". I've tried installing 'Android emulator' in the SDK tools but android studio still cant detect it.
Android Studio device list shows "loading" and no devices connected. Thus, I opened emulator but I cannot run flutter on emulator on Android Studio. After 5 hours I found that the reason is the new Flutter version.
I solved with choose different version of Dart and Flutter!
You need to download 1.17.3 version. Quick download link: Dowloand Flutter SDK 1.17.3 Version
And switch Stable Channel & Dart: 2.8.4, this is important. Also, if you want, you can check all versions of Flutter SDK: Flutter Versions
On MacOS, just write terminal: flutter channel stable
Note: If this answer is not working for you, you can open android module of your flutter app in Android Studio. It can be helpful when you try to add Firebase skills.
I had same problem.
CMD: flutter devices
No devices detected.
CMD: device emulators
Device emulator-5554 is offline.
In Android virtual device manager, I cold boot emulator and it started working.
In a windows platform I did:
If you have ran flutter doctor and there is no issues and if you can run your flutter app in cmd or using VSCode:
Just try to open Android Studio or IntelliJ as administrator by right clicking on the icon. This may list down devices and solve your problem.
The reason may be you have cloned flutter repository or you don't have right permission in flutter installed directory.
Run flutter doctor command to check whats the problem.
In terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device.
Check your flutter plugin whether it is up to date.
And read this flutter run: No connected devices , You may find the solution.
For me (on a Mac) I had the Android SDK installed in a custom location so I needed to set the ANDROID_HOME environment variable. In the terminal you can check what this value is with:
echo $ANDROID_HOME
I added the Android SDK to my .bash_profile (might be a different file if you are using Linux or Windows) for both ANDROID_HOME and PATH.
# already had these
export PATH="$PATH":"/opt/android-sdk/tools"
export PATH="$PATH":"/opt/flutter-sdk/bin"
# added this
export ANDROID_HOME="/opt/android-sdk"
Replace /opt/android-sdk with wherever yours is.
Then I updated the variables with
source .bash_profile
Testing with flutter doctor showed it was working.
flutter doctor
I restarted Android Studio and the emulator worked.
The last version of Flutter 1.17.5 (release the 2th, July) solved this issue for me.
Just flutter upgrade
run Flutter doctor to make sure you install everything.
run Flutter devices to see whether it is detected by flutter or not.
if you can find the your emulator there run flutter run -d <YOUR_EMULATOR_ID>
if you unable to find your emulator there may be you have to accept the android licenses . run flutter doctor --android-licenses to accept.
run flutter emulators to see list of emulators you have.
run flutter emulators --launch <emulator id> to launch
run Flutter devices to check whether emulator is detected by flutter or not.
run flutter run -d <YOUR_DEVICE_ID>
What worked for me is, updating Android Emulator.
Visit SDK Manager
Check whether any updates available for Android Emulator
If available, install the newest version
Hope this would be helpful!!!
I had this issue on Android Studio.
I had an emulator but it was not recognized even though the emulator was open.
I got around this by launching developer mode inside of the actual emulator by following the steps in this link: https://tweaklibrary.com/how-to-enable-developer-mode-on-android/#:~:text=How%20to%20Enable%20Developer%20Options%20On%20Android.%201,one%20of%20the%20most%20powerful%20...%20More%20items
After setting the emulator to developer mode, the emulator phone appeared as an option and when I ran the flutter hello world it appeared on the emulator.

Android Studio detects device only after running it the second time

I have Android Studio 2.3.2 installed on my Windows 10. These are the steps I have to undergo to get my code working.
Open Android Studio.
Android Monitor doesn't detect any device.
I type adb start-server in the Terminal.
Close Android Studio.
Reopen Android Studio
Now the Android Monitor initializes and detects my device.
Now, I don't want to go through the first 4 steps. What should I do?
P.S I have tried running the adb start-server from command prompt before doing the first step, but that changes nothing.

Why does my android project show dead?

Android studio project shows dead in the Android monitor while my project is running perfectly in device and emulator. i have cleaned and rebuild the project also
Tools-> Android- >Enable ADB integration cick here in androoid studio to see logcat

Resources