Cannot Connect Android Studio To My Phone Or Bluestacks - android-studio

I have been trying to connect Android Studio to a device, but have not been successful. No matter which device I use, none of them are recognizable by Android Studio. I have tried following the official tutorial of running your app, this Stackoverflow post as well as this one. I then tried to connect to Bluestacks using this tutorial. None of the above links work for me. ADB does recognize the devices I have been using (Bluestacks and my Huawei Y7 Pro). Any idea of how I can get Android Studio to recognize a device?

I managed to solve this issue:
I went back and retraced my steps. I noticed this error on the
console: Error
I then researched this error and found this solution:
Click on 'File' on the top left corner of Android Studio editor.
Select 'Settings'.
Select 'Kotlin Compiler' from the left.
Make sure 'Language version' and 'API version' is set to 'Latest stable (1.3)'
Make sure 'Target JVM version' is set to '1.8' (this was the problem in my case).
Wait for a while.
And if you haven't yet configured developer mode on your device then follow this tutorial.

Related

Android Studio 4.0 doesn't recognize any previous virtual devices

First post--be gentle. Can't find any posts on Android Studio 4.0, so I hope this isn't a repeat. I updated Android Studio from 3.6.3 to 4.0 on Windows 10 (1909). Had created a couple of virtual devices in 3.6.3 (a Pixel 2 running API 28 and a Pixel 3 running API 29)--both worked great in AS-3.6.3 and I could develop apps, compile, load, and run them with no problem.
After the update to AS-4.0, the virtual devices no longer appear in the devices box at the top of the GUI--it just says "No Devices". When I open the AVD Manager, I can see them, and I can start them (although when I start them I get a pop-up saying "AVD Manager: Unable to locate adb"), but I can't get any code to download and execute on it. On the Pixel 3 emulator, I also get another pop-up saying "Detected ADB: Could not automatically detect an ADB binary.", and it gives instructions to resolve it, which don't make any difference (jump into extended controls and toggle "Use detected ADB location").
When I try to open a past project and run it, I get the same behavior--no devices found.
I've also tried making new emulators, hoping the new setup would recognize them, but to no avail. Tried starting and restarting AS, as well as the computer, also to no avail. I have Android SDK Build-Tools 30-rc4, the latest Android SDK Command-line Tools, Android Emulator 30.0.12 Android SDK Platform-Tools 30.0.1, and the Intel x86 Emulator Accelerator all installed.
I've Googled and spoken words of fierce power over this for several days now. Any suggestions for how to get AS-4.0 to recognize the emulators? I've resisted uninstalling everything and starting over--was hoping it was just a configuration thing.
Thanks in advance,
Uber
After some more Googling, I found the answer here (I think my constraint of wanting an answer for AS-4.0 specifically kept me from finding it):
Could not automatically detect an ADB binary - Android Studio
I had to redownload the SDK platform-tools zip file and reinstall it. I don't know why the old one got messed up with the migration from AS-3.6.3 to 4.0, but there you go--such is life with complicated software.
As soon as I replaced the old platform-tools directory with the new one, all my old emulators showed up and I was back in business.
Thanks anyway!
Uber

Did Android Studio 3.6.1 remove the connection assistant?

A young friend of mine would like to push a game created using www.buildbox.com to his Samsung Android Tablet. He is using Windows 10 and Android Studio 3.6.1.
But the Device Drop Down is greyed out and for some reason the AVD Manager, the SDK Manager and the Connection Assistant are missing from this tools menu.
On my Android Studio 3.4 I can still see the Connection Assistant
I checked the Release notes but could not find anything.
https://developer.android.com/studio/releases
I checked that Windows can see the tablet as a USB device and the friend told me that developer mode is enabled.
Any ideas what is going on ?
So I got a chance to look further into the problem.
It turned out, that the problem seems to be with Buildbox not generating a proper Android project. In particular the generated project is missing a proper module and a proper app configuration. Once I added those the missing connection tool reappeared.
However I still got an error.

android studio emulator not selectable

I want to start coding with flutter, so i decided to download android studio.I created an avd called "Pixel 2 API 28" with android pie. When i want to select the pixel 2 as the avd device, the programme tells me that theres no avd, but on the right i can see the avd i created. When i put my cursor on it, it says "not applicable for the main.dart configuration". i have HAXM installed and Hyper-V is disabled, but i also tried it with both being active. I used the default code, which appears when you launch android studio.
Please help!!!
Edit:
I somehow managed to select it now, but i get this error: Running multiple emulators with the same AVD is an experimental feature. Please use -read-only flag to enable this feature.
Try starting the emulator from avd and then check if the device is showing up there if not try running
flutter devices
If the device shows there you can try running
flutter run -d <your-device-name>
You can also check whether the android sdk is configured with flutter try running
flutter config --android-sdk /path/andriod/sdk
hope it helps
Close Android Studio and Run again as Administrator
This is Only the solution i got after working hard for 3 days.

Android studio, Bluestacks Installation failed due to: 'closed'

I am trying to build an android app using bluestacks (my phone died)
Android studio can see the emulator in the devices list but when i try to run my app, android studio throws this error:
Installation did not succeed.
The application could not be installed.
Installation failed due to: 'closed'
Retry
I have tried launching both android studio and bluestacks as administrator.
I have also tried opening the standalone device monitor in the SDK tools folder
This throws another error :
could not open Selected VM debug port(8700)
The error log of the monitor contains lots of errors of missing directories.
error log: https://pastebin.com/mmA83ch7
thanks
Go to Settings -> Preferences and Enable Android Debug Bridge, Enable android input debugging
So someone on the bluestacks team decided that putting an adb toggle in "Preferences" and not in "advanced" was a good idea,
also literally not on any other single post has anyone said to make sure adb was toggled on.
the seting is in Setings -> Preferences, at the bottom
Open BlueStacks Go to Settings -> Advanced and Enable Android Debug Bridge, Enable android input debugging
Restart Bluestack and then Android Studio, this will make the connection.
happy debugging :)

Android studio no longer detecting device after update

A few hours ago, my Android studio was working very fine. I could write, build and run on my test device (TECNO K7).
I decided to update my Android Studio to 3.5. The whole process went well except that I cannot find my device among the list of devices any longer. I have also tried with multiple devices, I got the same outcome. When I click on the run-button, the app runs on the Pixel 2 emulator. However, I want it to run on my device.
Here's a screenshot of what my menu looks like. Note that the device (TECNO K7) is currently connected:
Is there something I am doing wrong?
UPDATE:
I tried restarting my ADB server and I go the following error:
Unable to locate ADB.
I have also tried re-installing the following tools multiple times, still the same outcome:
Android SDK tools
Android SDK Build-Tools
Android SDK Platform-Tools
PS: For reference, I use Mac OS and it is also important to remember that my Android studio was working perfectly fine before the update.
Solution:
Drivers not installed: If the Android Physical device is not a Google/Nexus product than you have to download the OEM drivers of the particular model.
HAXM not installed properly : Hardware Accelerated Execution Manager must have not installed properly on your computer. Try reinstalling it directly from the options available in your SDK.
No proper Path : Sometimes though the files are available in the local system, The Android Studio is not guided with the accurate path name to reach the file.
Hope this will be useful to you.
After spending hours on this I found that the Studio update had un-assigned an SDK for my project.
Selecting File -> Project Structure, then selecting an SDK under 'Project SDK' immediately displayed the 'allow debug on this device' dialog on my phone, then within a few seconds after accepting it, the device showed up in the device list.
Go to:
File > Invalidate caches/Restart > Invalidate and Restart
That should work.
Before going to bellow steps make sure
Your "Google USB Driver" package is installed ("Tools" -> "SDK Manager" -> Check "Google USB Driver" -> "Apply" -> "Ok").
If you are trying to access with emulator then check "Intel x86 Emulator Accelarator(HAXM installer)" is instaled. ("Tools" -> "SDK Manager" -> Check "Intel x86 Emulator Accelarator(HAXM installer)"" -> "Apply" -> "Ok")
Go to Tools.
Then go to SDK Manager.
Open SDK tools.
Uncheck "Android SDK Platform-Tools" (On my case it was checked).
press apply then ok.
Again goto Tools.
Then goto SDK Manager.
Open SDK tools.
check "Android SDK Platform-Tools"
Restart Android Studio :)
Hope this will help somebody like me.
This option is definitely not the most optimal. I eventually deduced that the problem was with my HAXM and simply re-installing this would have solved the problem. If you face, this exact problem, simple re-install the HAXM in your SDK.
I hope this helps someone out there.

Resources