Build.Xml Error

edited November 2013 in Android Mode

I followed the tutorial here http://processing.org/tutorials/android/ on how to install the SDK, and I get an "Error inside android tools, check tools" error.

the error appears as is below.

BUILD FAILED
C:\Users\GlaDoS\Desktop\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
C:\Users\GlaDoS\Desktop\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
C:\Users\GlaDoS\Desktop\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
C:\Users\GlaDoS\Desktop\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:284: null returned: 2

Answers

  • edited November 2013 Answer ✓

    Which version of the SDK are you using? The currently recommended is version 18 (not 19) as several problems have been reported with that version. See @codeanticode's reply to this thread for more details.

  • I installed all packages as the tutorial said, I'd assume it would just use the most recent version, which is 19. I just tried uninstalling version 19, but I still got the same error :/

  • Did you read the link I provided? To quote:

    A small update: earlier I suggested that using rev 18 of the android tools (with Processing 2.0.3) was a temporary workaround to use the android mode. It turns out that this information is incomplete. Some simple sketches would work, but more complex ones using sensors, etc, still gave build errors. The following versions of Android Tools, however, probed to be quite good:

    Android SDK Tools: 22.3 Android SDK Platform-tools: 19 Android SDK Build-tools: 18.1

    Using the combination above I've been able to run android sketches without problems (again, 2.0.3 only), even using contributed libs like ketai and oscP5.

  • I read the link, and from my understanding I need to switch from Version 19 to 18.1. how am I supposed to do that exactly? I tried uninstalling version 19, in hopes that the processing would revert to the most recent version I have installed, but that didn't work.

  • Open the SDK Manager... look at the list of available / unavailable packages... and selected the 18.1 packages. Install them.

  • Still getting an error from the build.xml file.

  • edited November 2013

    I seem to be getting this error after doing some troubleshooting on my own. Still in the build.xml file

    C:\Users\GlaDoS\Desktop\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:397: Problem: failed to create task or type checkenv
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any <presetdef>/<macrodef> declarations have taken place.
    
    
    Total time: 0 seconds
    
  • Okay, In hopes people are still monitoring this thread, or will come here in the future, most of my errors were fixed my changing my environmental variables, editing the AndroidManifest, and making sure I had the JDK installed. I know I'm a noob but have some faith in me guys, i'm really trying and don't want to just waste your time. At the moment I am getting stuck with the "Lost connection to device" error while trying to run my sketches on an emulator. I can the emulator, but sketches don't appear on it. I have an android phone I could test on, but tutorials on how to do so seem sparse. Thanks for your guys' time.

  • Answer ✓

    I would recommend testing on the phone rather than the emulator, as the phone provides a much more realistic environment (has sensors, multi-touch, and a dedicated CPU / GPU, so sketches will run a lot faster than in the emulator)... unless you have a device that is incredibly sub-par, or uses a really old version of Android (like 2.x, but I would just root it and get a newer version, anyway...).

    In general, I find the emulator easier to set up but far more error-prone than the phone. The phone can prove incredibly difficult to set up (device drivers), or it can be as simple as plugging it in. Regardless, since the phone development-cycle was set up, I have been thoroughly satisfied and wouldn't consider going back to the emulator for anything.

    As for getting the device set up, this can be either challenging or trivial (as stated above). There's no tried-and-true method as the process varies from device to device and from Windows to OSX or Linux (and, perhaps, country to country). The best thing that you can do at this point is plug the device in and try it.

    On your device, you'll need to go to Settings > Applications (or Developer Options, depending on your phone... also depending on your phone, you may need to enable Developer Options) and select "Enable USB Debgging". There are several tutorials about this much, such as the Android partition of the Processing Wiki (which you have probably read already if you've made it this far).

    As preemptive action (in case the device setup doesn't work for you), the first thing to try is to open a Command Prompt (or Terminal, Shell, or whatever) and type adb devices. If your device is listed as online, then you're golden. If it's listed as offline (or something else, I can't remember exactly), then you have some problems. If your device isn't listed at all, then you have even more problems. If you get something like adb is not recognized as an internal or external command, then you have very serious problems, but this one can be fixed quite simply by adding adb to the PATH variable (on Windows) (it should be in the Android SDK folder). I can't go into much more detail without making this (already long) response any longer.

    If you still want to get the emulator working, we can help you with that as well... but I, personally, have less experience with it. I would recommend testing on a device.

  • First off, thank you so much for your help so far. You are probably the most prominent member on these forums, and going back to old threads trying to solve problems you have probably single handedly solved 2/3 of my processing issues, and for that calsign, I thank you.

    It seems like I need to fix my path, and I'll go ahead and do that right now. That part shouldn't be too hard to figure out. I currently have a Samsung Stratosphere which is less than compatible with many products, therefore there are less troubleshooting resources out there, but I'll see what I can do to get it working. The strange thing is that i've been trying to get the SDK on a laptop too, and I seem to have the same exact string of errors and fixes. Currently when I plug in my phone and try "Run from Device" as a shot in the dark, I get the same error as if I was using an emulator. I'll keep everyone posted if I get more errors or I hit another wall in my hours of troubleshooting, but thanks again for all the help.

  • Alright, I just added a path for ANDROID_TOOLS and ANDROID_PLATFORM_TOOLS, downloaded a motorola driver, and edited the basic Path yet and adb still isn't recognized.

  • edited November 2013 Answer ✓

    i have been trying to set android mode for a couple of hours and its a bit painful.. the strange thing is that the same configurations do not work in different computers both with linux.... i `ve managed to to have a working emulator in debian 64 but not on ubuntu 32..that is strange...but this configuration works just fine

    Android SDK Tools: 22.3 Android SDK Platform-tools: 19 Android SDK Build-tools: 18.1

    from what i understood so far, if the emulator works then the device will also work (provided that the appropriate SDK is installed)....

    check also this link http://www.artsnova.com/blog/2013/06/13/572/

    indeed, calsign is in every thread that i have read with android problems..i really cannot thank you enough :)

  • The thing is that my emulator runs from the AVD, but It won't connect to the emulator OR my phone to get the sketch running. It just sits at the "Waiting for device to become available" stage until it eventually fails. I am also running windows 7, 64 bit.

  • I took a look at that article, and I don't have the android:debuggable set to true, but my AroidManifest file doesn't seem to have that chunk of code anywhere

  • what exactly are you trying to do in your sketch? does something as simple as that works?

    void setup(){
    }
    
    
    void draw(){
      background(100);
      rect(mouseX,mouseY,100,100);
    }
    

    do the file -> examples work? (excluding the ones that use P3D,OEPGL)

    do you have a project.properties file?

    try also to add debuggable :true but hand

  • As of now I am simply trying to run a blank script on the emulator, or my samsung stratosphere. I am currently at school so i will have to wait until another 6 or so hours to try the examples. When I search the SDK folder, several Android Manifest folders appear, so I have edited each of them and cannot seem to find the debuggable: inside any of them. Once I get back home I will check if I have a project.properties file, but if you could give me the directory of the Androdid Manifest I have to edit, It would be much appreciated and save em the time of editing every one inside my SDK folder. As stated above, after editing my enviromental variables cmd prompt still won't recognize the adb command, and I think that is the basis of the error I am getting.

  • Answer ✓

    Changing the android:debuggable property shouldn't effect anything. Disabling it will make it so that error messages from the sketch don't show up in the console (and some other stuff that's slightly less relevant in this context)... but this won't make a difference if you can't run the sketch in the first place. It is probably a good idea to have it turned on for the future.

    The AndroidManifest.xml file that you want to edit should be located in your sketch folder (Sketch > Show Sketch Folder in the PDE), but again, this is unrelated to getting the sketch to run on the device.


    I am assuming that you're on Windows because you mentioned the PATHs (unless this feature is present on other operating systems and I don't know about it).

    Are you still unable to find ADB from the Command Prompt? If this is the case, then you need to add it to the System PATH variable... It should be located in the ...Android SDK/platform-tools folder.

  • Okay, I have located my project.properties file. I also added the debuggable line to the android manifests, yet the error persist.

  • Heh, what a coincidence, we posted at the same time. I'm on windows 7 64 bit and added a system path variable. Now adb is working and it says list of devices attached: followed by nothing.

  • Answer ✓

    Most likely: You have to get a device driver for your device.

    Perhaps the driver in the Downloads tab of your device's page will be sufficient.

  • I just tried adb devices for the stratosphere and an htc incredible, both post driver install and adb kill-server and adb start-server Yet no devices are showing up.

  • my current API is 10, could it be the phones can't handle that version?

  • Ah, my usb cable was damages so It was being charged yet it wan't being recognized by the computer. I will come back with an update after I try a different cabel. Also here is a GREAT future recouce to fix adb errors.

    http://theunlockr.com/2009/10/06/how-to-set-up-adb-usb-drivers-for-android-devices/

  • Ha, after an estimated 10 hours of troubleshooting, it works! Thanks for all the help everyone!

  • Good to hear that you got it to work! I will take not of that link and provide it (as well as this post) to people that have similar problems in the future.

Sign In or Register to comment.