10

I have a strange problem which cannot find any fix for it. Every thing is OK for the first time when i open emulator and AVD run normally. but after 5-10 minutes, the emulator disconnect,it lose it's internet connection and i cant connect to it,also the Android Studio completely stuck and nothing happen ! I should close the emulator and after that everything become normal again.

These are what I tested :

adb kill-server and then adb start-server

I also tried connecting and disconnecting again

adb connect localhost:5554 and also adb connect emualtor-5554 but still no result.

The worse part is that I can't use Android Studio anymore, even clicking on lines of codes don't work!

Every time I should close the emulator and open it again.

NOTE : I can't use Genymotion, and I don't want to use my device for debugging!

Can any body have any fix for this damn bug. it made me crazy ... thanks in advance

EDIT :

The problem is not something related to emulator. Today I try to debug with WiFi connection. Everything was good for a while till the problem happened again with my real device. In log it said :

deviceXXXXX disconnected

So the problem is with my ADB connection !

What I tested was adding port 5555 to firewall also added ADB to pass through firewall. But still the problem persists.

AmiNadimi
  • 5,129
  • 3
  • 39
  • 55
Omid Heshmatinia
  • 5,089
  • 2
  • 35
  • 50

2 Answers2

2

What's your android studio version, jdk version, os?

What api are you targeting?

Can be a problem with new feature of android studio 2 instant run.

First try would be turn in off.

Be aware if you are targeting N Developer Preview is required to use Java 8.

More radical way is to rollback to android studio 1.5 and test.

Maxim G
  • 1,479
  • 1
  • 15
  • 23
  • android studio version 2.1 jdk 1.8 targeting api 22 i will try turning instant run off and inform you again. @Maxim G – Omid Heshmatinia May 05 '16 at 20:57
  • Thanks a lot. The problem was with my instant run. As i turned it off, the problem gone. – Omid Heshmatinia May 07 '16 at 05:59
  • I have the same issue but disabling instant run doesn't seem to fix it. Can you specify how you disabled it. Maybr I am doing something wrong. Thanks. – Para Jan 21 '17 at 11:21
0

You might need to do these : Wipe user data (emulator)

(install zlib.i686) execute these command,this is common gradle problem and known for crash/freeze of AS

hemen
  • 1,460
  • 2
  • 16
  • 35
  • On terminal of your emulator – hemen May 03 '16 at 13:19
  • i tried both adb shell instal zlib.i686 and adb emu instal zlib.i686 from my CMD but nothings happen . you mean i install a terminall on my emulator ? @cyborg91 by the way i'm using windows server 2012R2 – Omid Heshmatinia May 04 '16 at 03:51
  • Adb command should have done the trick....could you use genymotion instead.... Just a suggestion – hemen May 04 '16 at 05:16
  • no unfortunately, it couldn't connect to VM although i done everything required. The problem exist when i use Wifi debugging too. so there is no assurance that i won't have such a problem with the Genymotion! Thanks a lot for your time @cyborg91 – Omid Heshmatinia May 04 '16 at 05:26