# Emulator doesn't work

**URL:** <https://discourse.processing.org/t/emulator-doesnt-work/18601>\
**Category:** Processing for Android\
**Created:** [March 11, 2020, 2:50pm UTC](https://discourse.processing.org/t/emulator-doesnt-work/18601 "2020-03-11T14:50:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kobz](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kobz](https://discourse.processing.org/u/kobz)\
**Post date:** [March 11, 2020, 2:50pm UTC](https://discourse.processing.org/t/emulator-doesnt-work/18601/1 "2020-03-11T14:50:28Z")

</div>

Hi every one;

I’m a new user of android processing, i added this last mode (android) but when I tried to do a simple emulation based on the emulator by lunchinh this simple started programme  
void setup() {  
fullScreen();  
noStroke();  
fill(0);  
}

void draw() {  
background(204);  
if (mousePressed) {  
if (mouseX \< width/2) {  
rect(0, 0, width/2, height); // Left  
} else {  
rect(width/2, 0, width/2, height); // Right  
}  
}  
}

%%%%%%%%%%%%%%%%  
the software display this messsage “lost connection with emulator while launching. try again”

and display as follow:

Build folder: C:\Users\start\AppData\Local\Temp\android943141544518804092sketch

> Task :app:preBuild UP-TO-DATE  
> Task :app:preDebugBuild  
> Task :app:compileDebugAidl  
> Task :app:compileDebugRenderscript  
> Task :app:checkDebugManifest  
> Task :app:generateDebugBuildConfig  
> Task :app:prepareLintJar  
> Task :app:generateDebugResValues  
> Task :app:generateDebugResources  
> Task :app:mergeDebugResources  
> Task :app:createDebugCompatibleScreenManifests  
> Task :app:processDebugManifest  
> Task :app:splitsDiscoveryTaskDebug  
> Task :app:processDebugResources  
> Task :app:generateDebugSources  
> Task :app:javaPreCompileDebug  
> Task :app:compileDebugJavaWithJavac  
> Task :app:compileDebugNdk NO-SOURCE  
> Task :app:compileDebugSources  
> Task :app:mergeDebugShaders  
> Task :app:compileDebugShaders  
> Task :app:generateDebugAssets  
> Task :app:mergeDebugAssets  
> Task :app:extractTryWithResourcesSupportJarDebug  
> Task :app:transformClassesWithStackFramesFixerForDebug  
> Task :app:transformClassesWithDesugarForDebug  
> Task :app:transformClassesWithDexBuilderForDebug  
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug  
> Task :app:transformDexArchiveWithDexMergerForDebug  
> Task :app:mergeDebugJniLibFolders  
> Task :app:transformNativeLibsWithMergeJniLibsForDebug  
> Task :app:processDebugJavaRes NO-SOURCE  
> Task :app:transformResourcesWithMergeJavaResForDebug  
> Task :app:validateSigningDebug  
> Task :app:packageDebug  
> Task :app:assembleDebug

BUILD SUCCESSFUL in 28s  
28 actionable tasks: 28 executed  
Shutting down any existing adb server… Done.

%%%%%%%%%%ù  
the emulator didn’t work and based on the device connection of my phone also didn’t work dispeat if following the instruction exactely as given by the processing team

please help me to start

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [March 11, 2020, 3:08pm UTC](https://discourse.processing.org/t/emulator-doesnt-work/18601/2 "2020-03-11T15:08:55Z")

</div>

Sometimes you need another emulator, it has given me a lot of headaches as well, and I prefer the USB connection. You have to install the correct driver of your device and even then it almost only works with the port on the back of the PC.  
Mostly I work with the APDE app. It compiles within seconds.

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [March 13, 2020, 10:07am UTC](https://discourse.processing.org/t/emulator-doesnt-work/18601/3 "2020-03-13T10:07:17Z")

</div>

@kobz ===  
if you are starting with Android use USB (or APDE as @noel says) and forget the emulator; creating an emulator (if you want to test your app with different devices) can be useful but it is not easy because you have to understand and know a lot of things about android before…As for your problem your code seems to be good, it s only a question of connection with the emulator and that can occur for a lot of (mysterious!) reasons.As for me i have seen that the best way was to launch the emulator before and then try to compile but finally i left the emulators for real phones…
