Running sketches on my smartphone does not work anymore

edited March 25 in Android Mode

Hello Processing community,

everytime I launch a sketch on my smartphone the sketch immediately stops and the message "[sketch name] stopped" pops up (on my smartphone, Samsung Galaxy S6, Android 6.0.1). A few days ago I didn't have this problem. I already tried:

  • restarting both my smartphone and desktop pc
  • reinstalling both Processing and the Android Mode (and the Android SDK)
  • using another account on my desktop pc

It doesn't matter what's inside the sketch, even an empty program or an Example by Processing don't work. Everything works fine on the Java Mode.

Please help me



  • If you post your code, people will try to see if they can reproduce your problem.

    another suggestion is to use older versions of Processing and Android mode.

    Just to add some relevant information to your post, what OS are you using? Is this Processing 3? What libraries are you using? What is your selected/target Android API?


  • edited March 25

    "If you post your code, people will try to see if they can reproduce your problem."

    It doesn't matter what's inside the sketch, even an empty program or an Example by Processing don't work. (this is copied from my original question)

    • OS: Windows 10
    • Processing Version: Processing 3.3
    • Libraries: None
    • Selected Target API: It says API 6.0 (23)

    I'm going to try to use older versions of Processing and Android Mode. Thank's for your answer

  • @Problemhaber===

    not any error code?

  • edited March 25


    I am also having the same issue.

    I am running processing 3.2.4 on windows 10. My android API is 23. I am getting no errors while building, but when I try to exectute the application on the phone it immediately closes with "[sketch name] stopped". I installed the latest stable version (3.0.2) of the Android mode via the mode manager.
    The phone is running android 6.0

    The sketch I am trying to run is the basic example from

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

    Thanks in advance!

    Edit: I tried the unstable new release (4.0beta5). It gives more detailed errors. The things happening are exactly the same as before, building gives no errors. On the phone it immediately quits.

    Now it gives the following error in the processing IDE: FATAL EXCEPTION: main Process: processing.test.emergent_android, PID: 16074 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.emergent_android/processing.test.emergent_android.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "processing.test.emergent_android.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.emergent_android-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.emergent_android-2/lib/arm, /vendor/lib, /system/lib]]

  • @somethingrandom===

    try to put fullScreen() not in setup() but in void settings(). Have you the same error?

  • @akenaton

    no, there is no error code (except the warnings that the processing core library "is never used")

  • edited March 26

    I have the same issue. Even tryed on a clean instalation (new Windows 8.1 pro, new processing 3.3, Android mode from inside Processing)... Emulator opens, Android starts but every single sketch crashes immediately... I really need help with this. Thanks in advance

  • @ticAsm

    What OS are you using? Is this Processing 3? What libraries are you using? What is your selected/target Android API?

    You should try on an actual device instead of an emulator. By the way, have you run sketches in your phone before or is this your first time? For example, have you use Eclipse or AS?


  • edited March 26

    @kfrajer I bought an ssd disk and I am using a "clean"/fresh win 8.1 pro 64 bit; Processing 3.3; tryed the simplest sketches with no lib referencee (even tryed with an empty void setup and an empty void draw ). Not using any libs but there is ketai and cardboard inside library folder. Don't have USB connection with device. I Am looking, yet, for a generic USB driver for a Wiko device To try that also. This should Not be happening. I followed protocol: installing Processing first, installing Android mode from within Processing IDE; SDK was installed upon Processing detecting that no sdk was installed; emulator installed, also by Processing, when it detected that there was no emulator present. I Am really puzzled. Makes no sense. I get no errors. It compiles, sends it to emulator and crashes imediately.

    Thank you for your help, i really need guidance...

  • edited March 27


    verify your AVD parameters; it has to be targetting minSDK 16 (if this is also minSDK in the Manifest (you can edit it); verify that the path between your sketch folder and p5 is not too long. can you start your AVD ?

  • edited March 28


    I will check this. Nevertheless it should be straight forward to have processing (Android mode) installed. Processing+SDK+androidmode should do the trick. Following "protocol" should be enough. But i AM, surely, missing something. Are there any environment variables Not set? Any other software needed? I really need Processing Android mode working. I can start over if needed... Thanks!

  • From my experience, it is (was) as simple as Processing+SDK+androidmode plus enabling your phone to be accessed via USB and to have the proper USB drivers (done automatically by my OS btw). I have done this using Galaxy S4/S5 and Tab S with no issues...

    I don't have much experience with emulators btw so I can't help there.

    Few things to try:

    SDK was installed upon Processing detecting that no sdk was installed; emulator installed, also by Processing, when it detected that there was no emulator present.

    If you installed the SDK via Processing, probly not a good idea. I have seen posts before saying than installing the SDK manually and then providing the SDK path to Processing seemed to have solved some of these problems in the past.

    If you are running a provided example, hit ctrl+k to open your sketch folder and delete (or better... rename) your manifest file and then run your code. Processing will auto-generate a new manifest file. I had experiences before when running a provided example and the manifest was missing few key tokens. Instead of trying to figure out what it is missing, let Processing generate a brand new one. That solved my issues there.

    Third point is to use another phone if possible.

    Last thing, don't try the latest release of Android mode... like the Beta series. If you are in Android mode and if you open any of the menus and you find the options of wallpaper/Google Cardboard/etc. then you are using a beta. I cannot speak for the latest release of Android mode but previous versionsworks fine... This is not to say that the beta is not working. I just I haven't had the opportunity to try it out as much. Some other forum goers could comment more on this topic, specially if they have seen any issues.

    I can see we have three people posting here. This is good to have everything in a single post. Please remember to ensure your post describe your OS, Processing version, API target, Android mode version and type of phone. If you have any errors, copy and paste them here in the forum. This will help increase the knowledge base of this important issue.

    I agree that Android should be as easy as connect, set and run. A final suggestion is to get AS and try to get any demo running there. There will be more posts out there in the cyber space that can assist with issues specifically to your phone. Then you can migrate to Processing after you make sure your phone is able to run simple demos.


  • Hi all. I found a lot of similar problems trying to get this up and running today. I've managed to get it work (big thanks to you guys!). I'll post my problems and solutions here in the hope that it helps the topic:

    Hardware: Macbook Pro (late 2013) running Sierra 10.12.3, Samsung J1 (SM-J110M) running Android 5.1.1

    First problem was using the automatically Processing-downloaded Android SDK. I got the following error when trying to build on my device and the emulator: Failure [INSTALL_FAILED_DEXOPT]

    I then tried to use my Android Studio's Android SDK manually, where I got an error about "ant" and "tools".

    codeanticode suggests we don't use the tools past 25.2.5. So I grabbed the 25.2.5 tools from here, and swapped them into a separate copy of my Android Studio's Android SDK (switching the "tools" folders).

    I couldn't find where to edit Processing's Android SDK path so I did a reinstall to prompt the "Locate SDK Manually?" dialogue. I selected the Android SDK copy I made with the older tools implanted. And it works!

    Deploys onto the phone fine. Still having trouble with the emulator, though: "The default Android emulator could not be set up. Make sure that the Android SDK is installed properly, and that the system images are installed for level 22."

    n.b. The Continuously Check For Errors option in Preferences also doesn't seem to work while in Android Mode.

  • @Digl Thank you for posting this info and those instructions related to the SDK tools. I will be doing this myself later today.

    It seems the automatic install from processing have some glitches. I have seen posts here and there suggesting not to use it only when one runs into SDK installation troubles.


  • edited April 1

    In general: Sorry for the late reply! I expected to get an email notification that somebody replied.

    try to put fullScreen() not in setup() but in void settings(). Have you the same error?

    I have tried this, the error stays the same.

    I am not having more luck at the moment. I am still using the beta version, I will move back to the stable release. What I have tried however to use processing in Android Studio. I had a bit of luck there, however the cardboard library was failing me.

    edit: The error is now replicating with this:

    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/vrtoolkit/cardboard/Viewport; at processing.cardboard.PGraphicsCardboard.beginDraw(Unknown Source) at processing.core.PApplet.handleDraw(Unknown Source) at processing.opengl.PGLES$AndroidRenderer.onDrawFrame(Unknown Source)

    I found a similar error on the github repo:

    For my cause (and mainly experience) it would be easy if I can get the code directly running from processing. I have tried to run the code on emulator, Motorola Moto G and Samsung Galaxy S3 (all Android 6.0) all without succes.

    To summarize:

    OS: Windows 10 Processing: 3.2.4 (2505) API: 23 Android: 6.0 Phone: Motoreal Moto G Error:

    IDE: FATAL EXCEPTION: main Process: processing.test.emergent_android, PID: 16074 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.emergent_android/processing.test.emergent_android.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "processing.test.emergent_android.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.emergent_android-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.emergent_android-2/lib/arm, /vendor/lib, /system/lib]]

  • This thread didn't help me. I wasted so many hours trying to solve this problem. I will uninstall this program now and never use it again

  • edited April 12

    Has anyone figured this out yet? I'm having the same problem as @somethingrandom. Here are my specs:

    • Processing 3.2.3
    • Installed Android mode with the automatic SDK, API is 23
    • Windows 10
    • Samsung Galaxy s7 running on Android 6.0.1
    • Running initial setup code (and yes I've tried moving fullScreen() to settings and taking it out entirely)

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

    Everything seems to work fine on the computer end (no errors, just warnings) but when I run the app on my phone it crashes immediately.

  • Do you also have API 15 installed. I think Processing requires this, and should be set as the minsdkversion in the manifest

  • Even I facing the same problem. I have tried running the above code but in vain. Its crashing! Any pointers would be appreciated. Thanks in advance

  • Its crashing!

    You said you are facing the same problem. Please provide full details of your problem and platform and software as discussed in initial posts:

    Just to add some relevant information to your post, what OS are you using? Is this Processing 3? What libraries are you using? What is your selected/target Android API?

    There is also a fresh new Android mode version so make sure you indicate if you are using it. Also don't forget to mention your experience in Android mode, if you have run any application using other IDEs, like Eclipse or AS (you don't have to... but it is nice to know)

    When it crashes, is the application running in your device when it crashes or do you get an error message?


  • @hudson_m4000 thank you for your help but installing API 15 didn't fix my issue unfortunately.

    More details: I am not using the new beta version of Android (although I intend to use the Cardboard library from it once I get this problem solved).

    I don't get any error messages on my computer. The app opens on my device briefly (I see a black screen for a second) and then it closes and gives the pop-up message "Unfortunately, __ has stopped."

  • was having the same problem !

    I´ve reinstalled sdk not from processing but from sdkmanager on it´s own and connected to processing when ask, and know it works

  • edited April 17

    @Aurelian24 Thank you! Installing the SDK manually and choosing the path worked perfectly for me - I'm so relieved!

    ALSO: If you are in this thread looking to solve your Cardboard woes: 1. You need to install the beta version of Android (4.0 I think) 2. You need to install SDK manually (not through processing) and download API 25, Android Support Repository, and Google Repository. 3. Cardboard has been renamed to VR in the new Android.

  • thank god that worked - thank you!!!

  • @alayna and @kfrajer : I have not understood if the Android SDK is backwards compatible. Can you tell me if this should work even if I use an Android 6.0.1 device?



  • @mschillo - My phone is running on Android 6.0.1 and it works fine!

  • @mschillo

    When I install the SDK, I do it by also installing AS. Well, that is what I did the last time. Now, when I install the SDK, I find out that the ant scripts are not available anymore. The ant scripts come with the Android SDK under the "Tools" folder. From recent comments, I know that Google (ok... somebody?) decided to remove the ant scripts and now you have to build your Android project with gradel exclusively (Maybe there are other ways to do it... I can't comment on that). Processing uses the ant script to process your Android code. Since the ant scripts disappeared from the SDK, then different communities, not only processing, have been facing some issues to address these changes. I know that the Processing foundation is looking to migrating to Gradel, but I believe it is a project for this summer based on what I have seen in previous posts (so yes, nothing I say here is official btw)

    There is a temporal solution in the posts above. When one installs the SDK through AS,you don't have an option of choosing the Android SDK version. If you install the latest version, it doesn't have the ant scripts. The solution is that after you install the SDK, then you download the zip with the **Tools* folder (which is provided by @Digl above), unzip and move the tools folder inside the SDK folder. Mind you you need to move/remove the tools folder that comes with the freshly installed SDK.

    You could try to install the Android SDK using processing as discussed in instructions and previous posts. I am not totally sure it works all the time. It is hard to judge from comments how well this feature in Processing works. Base on my experience, it doesn't work. That is the reason why I always choose to install the SDK via AS. If installing the SDK via Processing works for you, then it is very likely that Processing is installing an older version of the SDK, one that has the ant scripts available. However, this is just my guess as I am not familiar with the layout of that part of processing. @codeanticode could comment more about that.


  • Thanks! It works for me now. Here is what I needed to do to get it working.

    Note: I'm on macOS

    • I previously had installed Android Mode 4.0-beta7
    • now I installed Android Studio.
    • On first run, it installs the sdk, but not in an obvious place but in ~/Library/Android/sdk/. This inlcudes Android SDK Build-Tools 25.0.2.
    • deleted folder ~/Library/Android/sdk/tools/
    • downloaded and extracted as suggested by @digl . Yields a folder "tools"
    • put that folder inside ~/Library/Android/sdk/
    • started Processing, opened a new sketch, put in example from web page
    • plugged in my android device, made sure it is visible in Processing->Android->Devices
    • it keeps complaining it lost connection to device. I checked dev mode and debug mode are on. replugged the device, maybe cable is not ok
    • got error message INSTALL_FAILED_UPDATE_INCOMPATIBLE, checked to find out that a sketch with that name was already uploaded on a different user on my device. So I followed advice to check Settings->Apps and uninstalled AndroidExample for all users.

    => It works! Only modern technology can make you happy by displaying a white and black rectangle :-)

    Thanks to all here, especially @kfrajer and @digl !

  • Really great to hear it works for you and thank you for sharing your solution. To clarify, that error in your last post was a new and different error from any previous experiences? I can see using different SDK versions to cause incompatibility issues on same applications. It is good to know your solution.


  • To clarify, that error in your last post was a new and different error from any previous experiences?

    Correct. It seems like the software I am running now does not cope with the app already existing, while the software I previously had tried did not complain.



  • I have a RCA Voyager 7" tablet running Android 6.0.1, I have the same problem as mentioned by alayna and somethingrandom. The code ( same as theirs) was installed on the device, but immediately crashed. I tried manually download sdk (API23) from sdkmanager ( it automatically put it in \Processing\modes\AndroidMode\sdk, no need you provide link path), but still does not work at all. My Processing version is 3.3 on Windows 10. Please help me!

  • This next is from the next link:

    Please provide all these next details:

    Processing version

    Android mode Version

    Operating system

    Target APIs you have tried (Installed through the Android SDK manager and visible in the Processing IDE Android mode)

    Android SDK version. Did you install it yourself or using the automatic installation offered by the Processing IDE android mode?

    Have you run Android apps in Processing before? In any other SDK like Eclipse or Android Studio (AS)?

    Is this your first time? Did you enabled the developer mode in your device?

    did you check the following website as a reference: Did you try any other set of instructions? Which ones? Can you provide your link?

    Are you running your app in an actual device or through an emulator? (NOTE: It is strongly recommended to do it on an actual device)

    In case you found something meaningful in the forum or in other site, please provide links (If nothing found... leave blank).

    Have you tried anything else? For example, renaming/removing the manifest and letting Processing recreate the manifest for you again? (To access the manifest, press ctrl+k in your sketch and there should be a file called "manifest.xml")

    EDITED:****** Extra questions as suggested by akenaton

    Have you activated the debug mode on your phone + what is your phone OS ? ) + give us more error code (not only the first 2 lines)

    Few things to try. Do not use the latest Android mode. It seems Android API target 21,23,25 seem to be ok.


  • @jctang46=== you say that you installed manually your sdk, i think that you don t downloaded it yourself from the android site because, in this case, it is impossible that it was "automatically" put in the android mode folder: it goes where you unzip it... TRY to download yourself and change the path to your sdk.

  • @mschillo many thanks for sharing. It worked for me too. I Am a happy camper now!

  • To: Kfrajer Procession version 3.3 on PC windows 10 Android version 3.0.2 for Processing 3.3 Operating system Windows 10 I only tried API23 (Android 6.0, because my RCA tablet runs Android 6.0 Marshmallow) I used Processing Android sdkmanager to download sdk API23 Rev. 3 (I used auto mode first, then open sdkmanager to re-download API23) I have not run Processing Android mode before, I only used Processing java mode. I have not used Android Studio (AS) before. I enabled USB debugger mode on my RCA tablet. I followed exactly from the link you provided to add Android mode. I run the test sketch on my RCA device, have not tried to use emulator. I removed the manifest.xml file each time before I ran the sketch. I used Processing to display some data from an instrument through WiFi UDP, but using Processing java mode. This is the first time I try to move the Processing display from a laptop ( Windows 10) to Android tablet. I have not tried my instrument display sketch case, only tried to use very simple case as mentioned by alayna. I think maybe my "manual download" was wrong, Please tell me how to use Android Studio to manually download (step by step). Thanks. To: akenaton Thank you to point out. I need to know how to "manual download".

  • Manual download... I refer to installing AS. When run the installer after you downloaded it (the AS installer file is close to 2GB) you will be presented with a menu option. I can't remember precisely what it says. I believe it says install AS and install Android SDK as well. I always install everything as I am also interested in the AS IDE. One of the next windows it asks where you want the sdk installed. use the defualt location or choose your own location. Remember this location. Then continue the installation process. When it is done, open AS to make sure everything is fine. Then you need to go back to Processing and switch to Android mode. This is another part that I am going to guess.... When you switch to Andoid mode it should ask you to either download the SDK for you or provide a path. If Processing givees you this option, choose the path route and then type the path that you used during the SDK installation.

    If you open Processing IDE and if you switch to Android mode and Processing doesn't ask you anything about the SDK, then I think you need to find the preference file, open the file and remove/reset the path for the Android SDK. Make sure Processing is not running when you do this. After you save the file, open processing and switch to Android mode. It should ask you for the Android SDK path (or auto-installation of the SDK)

    Another thing is, if you are in Android mode, go to the menu Android in the Processing IDE and click in the entry that says "SDK manager" and it should run the SDK manager where you can install different Android API targets.

    By the way, if you don't know where to find the preference.txt file I mention before, in the Processing IDE, go to the menu file>>Preferences and at the end of the dialog window you see the path of your preference.txt file.

    I hope this work for you,


  • @jctang46===

    you have only to go to the android site (not processing one) and download your SDK according to your laptop os (windows, mac, linux); you can also download AS which includes the SDK (as @kfrager said), yet if it s the first time that you work with android try the first solution; after having downloaded the SDK unzip it were you want, and change the path for the SDK in processing.

  • kfrajer and akenaton, I have downloaded Android Studio and sdk, but the sdk is API25 (platform-25). My RCA Voyager tablet runs Android 6.01 (API23). Do you think this sdk can be used for me? Or I need download API23 from other source? Thanks.

  • The target API is downloaded using the Android SDK manager. Either AP should work, specially for testing simple programs.


  • edited April 21


    25 (or more...) is the latest API for compiling then you have to fix your TargetSdk to .M (23) and your minSDK (16 or 17) for the last twos you have to download and install them from the SDK manager

  • When did the min sdk become 16 or 17. I thought it was 15 required by Processing?

  • kfrajer and akenaton, Thank you very much! Now I got my RCA tablet working with Processing Android mode (even just some simple test cases). At least I have got it through. Again thank you guys for help!

  • @jctang46 Great to hear it is working. For the record, could you comment on what you think you did in your side that did the trick and solve your problem?


  • edited April 21

    @hudson_m400=== it changed (p5 3.3) (and i cannot understand why because it pretends to extend appcompat)


    put answered (till now!) for others ...

  • I downloaded Android Studio from ( I don't know why this web page is written in Chinese, it mentions that it is the official website for Android. Fortunately I can speak Chinese) The green button is to download Android Studio version 2.3.1(1876 MB), it includes SDK (It is platform-25: API25, Android version 7.1.1 for Windows 64). I removed the existing sdk and re-started Processing 3.3. It asked me to provide path to the new sdk. But when I started to run a test case like alayna's on my RCA tablet, it stopped at the beginning. The error message showed that the ant folder inside the tools folder of the sdk is missing (a file called build.xml inside this folder is needed for the compiling) so it cannot compile the sketch (I don't know why is like that). I copied the whole tools folder from former download API23 ( I downloaded from Processing sdkmanager) to take over the one in API25. Then the sketch is built and working on my tablet.

  • @jctang46 Thank you for your detail post. By the way, I check the link and i get the English version. You probly got Chinese due to a local setting in your computer.


  • kfrajer and akenaton, I uploaded my instrument display sketch to my RCA tablet. The graphics/geometry looks good, but the WiFi UDP got a problem. At the beginning, the port even could be setup, it always showed EACCES (permission denied). I found that I need to check the "Sketch Permissions". So far I checked the following: Access_Network_State, Access_WIFI_State, Change_Network_State, Change_WIFI_Multicast_State, Change_WIFI_Sate, Internet, Read_Frame_Buffer, Read_Input_State. After I checked the permissions, the port seems opened no EACCES errors anymore, but the UDP is still not through. I don't know if I need to put more checks on or my code (working for Windows laptop) has problem in Android Mode:

    UDP udp;

    PORT_RX = 5555;

    String HOST_IP = "";

    void setup()



    udp = new UDP( this, PORT_RX, HOST_IP);

    udp.listen( true );

    } ......

    void receive(byte[] data, String HOST_IP, int PORT_RX){

    String value=new String(data);

    String[] input = split(value, " ");

    if(input.length == 3){

      float phi =   float(input[2]);
      float theta = float(input[1]);
      float psi =   float(input[0]);

    } `````` This code works for Windows fine. If you guys could give me some WiFi UDP reference code that works in Android mode? Thanks.

  • @jctang46 Regarding wifi/udp. please start a new post. Also format your code. To do that, select your code and hit ctrl+o and ensure there is an empty line above and below your code block.


Sign In or Register to comment.