Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Android Lesson can't run initial_setup.bat

Dear all, i am starting to learn Android developer lesson.

when i execute initial_setup.bat i got these message

" D:\android_dev_environment>echo no | .\android-sdk-windows\tools\android creat e avd -n Android41 -t 1 --force This version of D:\android_dev_environment\Java\jdk1.6.0_35\bin\java.exe is not compatible with the version of Windows you're running. Check your computer's sys tem information to see whether you need a x86 (32-bit) or x64 (64-bit) version o f the program, and then contact the software publisher. Invalid path The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified.

"

seems that java is not suitable. i am running windows 7 32 bit but i failed to run initial setup for both 32 & 64 bit version with same error messages

when i tried to install eclipse i got same failure.

please help.

10 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi everyone,

Sorry for the trouble about the Windows bundle! I've been seeing more and more issues about this particular error and need to figure out how to recreate it and fix it. In the mean time, here's the response I've been sending members who have emailed help@teamtreehouse.com:


Your best bet to address this might be to switch to the Google bundle available at http://developer.android.com/sdk. This wasn't available when we made our Treehouse bundle, but it's almost exactly the same thing. We actually switch to this in the 2nd Android project since it's the official (supported) bundle from Google.

Download that and you can follow along with only a few minor differences. Setting up the project is slightly different, but after that it's pretty much the same. Let me know if you have any trouble and I can help iron out the differences.

One other thing, our bundle includes an AVD (emulator), but with the Google bundle you need to create your own. If you have any trouble you can check the 5:30 mark in this video from the 2nd project: http://teamtreehouse.com/library/android-development/build-a-blog-reader-app/exploring-the-masterdetail-template/creating-a-project-using-the-masterdetail-template

Here's a StackOverflow question about this issue that might help shed some light on your situation: http://stackoverflow.com/questions/5411238/android-sdk-android-bat-does-not-find-swt-jar-file


Added 4/15/13

You might be able to manually configure your environment following the instructions in this Quick Tip video. Setting it up manually can be kind of a pain, but hopefully this Quick Tip spells it out in a way that addresses common problems.

James Barnett
James Barnett
39,199 Points
  • Double check what version of windows you are running
    • right-click computer --> select properties
    • note what it says under system type
  • Download the appropriate installer
  • Unzip the package
  • Run the inital setup
  • Specify the path as c:\users\%username%

Let us know if you are still having issues

Very nice to find this in Forum! I have the same problem - or my failure is:

"java.exe is not a valid Win32 application"

and it's the same, I guess.

I run XP 32 bit.<<

I have tried the above

James Barnett
James Barnett
39,199 Points

@Anna - Email help@teamtreehouse.com and they should be able to get you sorted out.

Hello, Ben! It doesn't help ;-( Now it says to me "A Java Runtime Environment or Java Development Kit must be available in order to run Eclipse. No Java virtual machine was found after searching following locations: C:\Development\adt-bundle-windows-x86-20130219\eclipse\jre\bin\java w.exe javaw.exe in your current PATH" Thank you for help!

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi Mariya,

Did you happen to move the bundle to a new location? If so, you would need to re-run the "initial_setup" script. That might be the problem, though I'm not quite sure from that error message. Or is this the Google bundle available from http://developer.android/com/sdk?

here too the problem occurs in the same way... it seems.[2013-09-27 11:41:21 - Emulator] PANIC: Could not open: C:\Users\Stark.android/avd/Android41.ini..could someone suggest me a way to find out

Ben Jakuben
Ben Jakuben
Treehouse Teacher

It's strange that your slashes are going both ways in that path listed for your emulator:

C:\Users\Stark.android/avd/Android41.ini

Can you try creating a new emulator yourself and see if that works? If needed, you can find some instructions around the 5:10 mark in this Quick Tip video.

Hello, I am having sort of the same issue. My emulator runs but it doesn't display what I am trying to run. I have not been able to move forward because of this issue. I deleted my bundle and downloaded the one in your link but I am still having the same exact issue. It seems like it might be a path issue. I am new to this so any help is appreciated. I am running Windows 8.1 64 bit

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Hi Odalis,

Can you create a new post to address this? When you try to run your app, what exactly happens? It sounds like nothing happens on the emulator. Do you get any information in the Console or Logcat tab in Eclipse? If so, copy and paste it into your new Forum post and we'll go from there.

When I try to run my app, the emulator runs but without my code. This is what the console states: [2014-04-15 18:25:31 - CrystalBall] ------------------------------ [2014-04-15 18:25:31 - CrystalBall] Android Launch! [2014-04-15 18:25:31 - CrystalBall] adb is running normally. [2014-04-15 18:25:31 - CrystalBall] Performing com.example.crystalball.MainActivity activity launch [2014-04-15 18:25:31 - CrystalBall] Automatic Target Mode: launching new emulator with compatible AVD 'Android44' [2014-04-15 18:25:31 - CrystalBall] Launching a new emulator with Virtual Device 'Android44' [2014-04-15 18:25:36 - CrystalBall] ------------------------------ [2014-04-15 18:25:36 - CrystalBall] Android Launch! [2014-04-15 18:25:36 - CrystalBall] adb is running normally. [2014-04-15 18:25:36 - CrystalBall] Performing com.example.crystalball.MainActivity activity launch [2014-04-15 18:25:36 - CrystalBall] Automatic Target Mode: launching new emulator with compatible AVD 'Android44' [2014-04-15 18:25:36 - CrystalBall] Launching a new emulator with Virtual Device 'Android44' [2014-04-15 18:25:40 - CrystalBall] New emulator found: emulator-5554 [2014-04-15 18:25:40 - CrystalBall] Waiting for HOME ('android.process.acore') to be launched...

Once it launches, it runs but without my text/code

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Hi Odalis,

Next time post this kind of question as a new forum post to get more eyeballs on it. But I might be able to help.

I don't know why this happens, but it happens to me sometimes, too. Usually I can run the project again and a second emulator will launch and the app will load in it. Then I just close the first. Try that, but if it doesn't work, start a new thread and we'll pick it up from there. :)

Hey Ben,

Is it necessary to add the "bin" directory from the JDK folder to the end of the "PATH" environment variable?

For example:

JAVA_HOME => C:\Program Files\Java\jdk1.7.0_21 <-- "As instructed"

PATH => C:\Program Files\Java\jdk1.7.0_21\bin <-- "This solved my issue on all 32/64-bit Windows OS's"

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Oh Windows! You aren't supposed to need "bin", but apparently you do need it on certain versions or installations. Glad you got it working! I'll add a Teacher's Note suggesting that as an option to try if without it doesn't work.

Thanks for the rapid response Ben. I shall continue to QA the rest of the OS installations as I progress.