Android Problems
in
Android Processing
•
1 year ago
I have seen numerous posts regarding problems with getting Android set up and running for the first time (with at least two in the past twenty-four hours) and, as I appear to be on "help everyone with Android problems" duty, I have decided to create this post, which anyone experiencing problems setting up and / or running Android sketches should check
before they ask their own question.
Before you look here, you should, of course, read the Wiki because a lot of your questions should be answered there.
Let's divide the possible problems into three categories: Build Errors, Emulator Errors, and Device Errors.
Build Errors
You have installed the Android SDK and are just starting out your first sketch when, all of a sudden, you get that big, nasty " BUILD_FAILED " message. This is where you should look for common problems.
First, there are a couple of things to check to make sure that you are doing:
Before you complain about Android Processing not working, you have to make sure that the code that you are testing with is valid. If you are unsure, try testing one of the Examples.
If, after that (relatively) short list of possible problems, you are still having issues (which you probably will), then please consult this next list of possible problems:
Emulator Errors
If you have successfully built your project (you don't get BUILD_FAILED ) but you cannot start the emulator (errors such as NOT_BOOTED or NOT_RUNNING ), then you've come to the right place.
If all of the errors mentioned above are resolved, then check the following:
Device Errors
Content to be supplied later
Lastly, there are a couple of pieces of information that are useful to us, people that are trying to help you, answer your question quickly, if your problem is not resolved my reading the above:
NOTE: This post is not completed, but I'm only one person. I'll try to get it finished in my free time over the next couple of days. If you have suggestions / comments, let me know through a reply. If any of my fixes help you, that is useful to know, too.
Before you look here, you should, of course, read the Wiki because a lot of your questions should be answered there.
Let's divide the possible problems into three categories: Build Errors, Emulator Errors, and Device Errors.
Build Errors
You have installed the Android SDK and are just starting out your first sketch when, all of a sudden, you get that big, nasty " BUILD_FAILED " message. This is where you should look for common problems.
First, there are a couple of things to check to make sure that you are doing:
- You must use the latest version of Processing (to get the latest version of Processing, go to the Download Page and select the most recent version.
- You must have everything that is required for Android Processing: Processing itself (see above), the JDK, and the Android SDK. You must have installed all of these correctly. The Android SDK is most likely to be installed incorrectly, and this is the main source of all of the build issues.
Before you complain about Android Processing not working, you have to make sure that the code that you are testing with is valid. If you are unsure, try testing one of the Examples.
If, after that (relatively) short list of possible problems, you are still having issues (which you probably will), then please consult this next list of possible problems:
- Make sure that Processing knows where to look for the Android SDK . The easiest way to test this is (from the PDE) to go to Android > Android SDK Manager . If the SDK Manager starts up, then your path is probably set up right. If not, then follow these steps below:
- Locate the Android SDK with a file browser. Remember the path.
- Open File > Preferences .
- Click on the link to the "preferences.txt" file at the bottom.
- Open "preferences.txt" (if it has not already done so) with a plain text editor.
- Modify the property "android.sdk.path" to be the location that you found earlier. If it does not exist, then create it. An example: "android.sdk.path=C:Program Files (x86)Androidandroid-sdk" (without quotes, and the example is from Windows using Windows slashes).
- If you're on Windows, then you might need to mess with the System PATH variables. You can edit the PATH variables by right-clicking on Computer > Properties > Change Properties > Advanced > Environment Variables . WARNING : Messing with these variables can seriously mess up your computer if not done properly. You should check the following:
- Variable JAVA_HOME should point to the location of the bin folder within the JDK.
- Variable ANDROID_HOME should point to the location of the bin folder within the Android folder.
- Variable ANT_HOME should point to the location of the ant folder within the android tools folder.
- Variable ADB_HOME should point to the location of the location of the android/android-sdk/platform-tools folder.
- All of these variables should be referenced from within the PATH variable. You can reference a variable by specifying its name surrounded by percent signs ( % ). In order for the variable to be properly unwrapped, it must be enclosed in percent signs and each individual variable must be separated by a semicolon. For example: "%JAVA_HOME%;%ANT_HOME%;ADB_HOME%;%ANDROID_HOME%"
- Are the right packages installed from the SDK Manager? (If you can't open the SDK Manager, then that's a problem of its own and you need to reinstall it, see above.) You should have the latest version of the tools and the latest version of the SDK. At writing time, these are 20.0.3 (for the tools) and Android 4.1 (or API level 16). If there are uninstalled packages, then you should probably install them. If you cannot see these packages, then this is a problem of its own. You might have to reinstall the SDK Tools or check to make sure that you are connected to the internet properly.
- Note: On Windows, you may need to make sure you run the SDK Manager "as an administrator", or else it won't be able install the packages in certain locations on your computer.
Emulator Errors
If you have successfully built your project (you don't get BUILD_FAILED ) but you cannot start the emulator (errors such as NOT_BOOTED or NOT_RUNNING ), then you've come to the right place.
If all of the errors mentioned above are resolved, then check the following:
- Open the AVD Manager and check to see if a Processing emulator exists. If it does not, then Processing could not successfully create an emulator. You can try creating one (such as "Processing-0206") by doing the following:
- Click the New button.
- Enter a name and select a target (must be at least API level 9).
- Everything else you can leave blank. Click Create AVD.
Device Errors
Content to be supplied later
Lastly, there are a couple of pieces of information that are useful to us, people that are trying to help you, answer your question quickly, if your problem is not resolved my reading the above:
- Your operating system
- What version of the Android SDK you're using
NOTE: This post is not completed, but I'm only one person. I'll try to get it finished in my free time over the next couple of days. If you have suggestions / comments, let me know through a reply. If any of my fixes help you, that is useful to know, too.