-1

im trying to build an android application under linux mint ,i have updated android studio to 2.2.3 , but when i run the app a message appears: Waiting for Target Device to Come Online , and then the emulator does not even start.

this my gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.0'
    defaultConfig {
        applicationId "bassem.com.vib"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.squareup.retrofit:retrofit:1.7.1'
    compile 'com.wang.avi:library:2.1.3'
    compile 'com.squareup.okhttp3:okhttp:3.8.0'
    compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
    compile 'com.google.code.gson:gson:2.6.1'
    compile 'com.squareup.picasso:picasso:2.5.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:25.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta5'
    compile 'com.github.PhilJay:MPAndroidChart:v2.0.9'
    compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1'
    compile 'com.itextpdf:itextg:5.5.9'
}
bams
  • 612
  • 6
  • 14
  • try the solution proposed [here](https://stackoverflow.com/questions/42831999/android-studio-2-3-ubuntu-16-10-emulator-do-not-start) – lelloman Aug 02 '17 at 09:45
  • @lelloman that assumes OP has ubuntu – Zoe Aug 02 '17 at 10:00
  • @LunarWatcher no, that assumes that OP might have the same problem that occurs on ubuntu and being ubuntu a more popular distribution than mint the question was already asked and solved. the question I linked is about ubuntu 16.10 but I'm having that problem for years on many versions. it is worth a try in my opinion – lelloman Aug 02 '17 at 10:08
  • 1
    There are other operating systems than Ubuntu – Zoe Aug 02 '17 at 10:15
  • it didnt work when i lunched it shows the emulator Could not launch '../emulator/qemu/linux-x86_64/qemu-system-i386': Not a directory – bams Aug 02 '17 at 10:43

1 Answers1

1

Android emulators not booting is an issue that happens rather often. The ANdroid emulators (the official ones) are very bad. Having too little RAM in the emulator or not good enough processor is enough for the emulator to not boot.

As far as I see, you have three options (if you don't have a real device and want to use that):

1) Give the emulator more RAM

2) Find a different emulator (bluestacks, genymotion, etc)

3) Get a better computer/CPU

First one can be configured in emulator settings. Second is because other emulators (I have tried Genymotion so I can mention that) have much better performance. The default Android emulator is extremely bad. I have pumped 3 gigs of ram into it, and I have an i7 processor and it still isn't enough to get it to get even close to a real device. I can get it to start, but I have to allocate a large amount of resources. If your computer has low performance or is old, that could explain why you don't get it to boot. Your computer doesn't have the resources to boot.

I would like to add the fact that this has nothing to do with your app. This is a hardware and software issue (software being extremely demanding + limited hardware can cause the issue).

The third option is if you want to run the default emulator and #1 didn't work. If you have allocated a lot of ram and it still doesn't run, your computer doesn't have the processing power for it to boot. If you then pick option #2 and that doesn't work (very low chance, assuming you have at least 4 gigs of ram on your computer and i3 or better (or equivalent of a different CPU brand) it should work with different emulators) you have no other option but #3. Your computer simply cannot handle the emulators in addition to Android Studio (which is very demanding in system resources as well).

If you absolutely have to use an emulator, I recommend you use Genymotion. In my experience, it has high performance even using low system resources. While it still has some lag, it still works very close to a real device and not an emulator. (works like an emulator = slow, laggy, etc. Works like a real device = like you have an actual device (performance-wise)).


The default Android emulator is extremely slow. That is something I think most Android developers and users of the emulator agree on. Getting it to function at least normally and avoid extreme lag requires (in my experience) a massive amount of processing power and RAM.

The issue you are experiencing is not an issue with your app, Android Studio or the emulator. (Well, technically it is an issue with the emulator, but it has always been slow). Because the emulator doesn't get enough system resources, it doesn't boot. It does in the background, most likely (unless it gets so little resources it gets an out of memory exception and crashes), and will eventually boot. But depending on how much resources you gave it, it can take hours.

My recommendation to solve this is either to get a better emulator or use a real device. The second is to prefer, as real devices are better than emulators.

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • i've installed genymotion and it works now . thank you – bams Aug 02 '17 at 12:50
  • It is possible to use the default emulator too, but is is a very demanding emulator. Kinda sucks as it is installed with Android STudio/SDK, takes up space when I don't use it – Zoe Aug 02 '17 at 12:57