Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Trouble Starting Android SDK Executables
New Posts  All Forums:Forum Nav:

Trouble Starting Android SDK Executables

post #1 of 13
Thread Starter 
Or rather, it won't start from the regular "SDK Manager.exe" or "AVD Manager.exe"

I've tried all the stuff I've found online; making sure that the jdk path was before the system32 path environment variable, setting a JAVA_HOME variable, etc. Both the SDK and AVD managers just flash a dos window and shut down.

I looked at the errors that just straight up starting tools\android.bat shows. The first one is that it seems to be screwing up with spaces in the path for the Java JDK; says something along the lines of 'D:\Program is not a valid ...' which means it's not running whatever the script equivalent is for putting quotes around the path. The workaround was to install the JDK in a path without spaces; I don't like it, but fine.

Next issue was with this line:
Code:
%java_exe% -jar lib\archquery.jar

For some reason, it can't find the directory on the right side. The fix was to fill the whole directory path, which doesn't make sense. It made the android.bat work, which then started the SDK Manager, but the actual executable still fails to load. I think this is the main problem (it not being able to reference a location like "lib\...", because the SDK and AVD executables in tools\lib\ send an error message that says it cannot find tools\android.bat, even though it's definitely there.

Basically, the question is, what does it take to get it to reference the base sdk directory (i.e. in my case, D:\android-sdk\) for those commands, so that it can find the right executables and files?

Thanks in advance!
post #2 of 13
have you tried to uninstall the JDK and the SDK and then install it again?
    
CPUMotherboardGraphicsRAM
Intel 3930K 5040MHz @ 1.48 - 1.53v @ VTT/VCCSA ... Asus rampage extreme IV Gigabyte GTX 970 G1 @ 1580/4050MHz @ 1.325V Corsair Vengeance 64GB (8 x 8GB) DDR3 2400MHz. ... 
Hard DriveHard DriveHard DriveHard Drive
Samsung 850 Pro 256GB Seagate Barracuda ST3000DM001 3TB WD Black 1TB 64Mb Cache  WD Blue 500GB 16mb Cache 
Hard DriveOptical DriveCoolingCooling
WD Black 4TB 64mb Cache LG DVD EK-FB KIT RE4 - Acetal EK-FC970 GTX WF3 Backplate - Black 
CoolingCoolingCoolingCooling
Laing D5 Vario 12V DC Pump (MCP 655)  EK-BAY SPIN Reservoir - Plexi EK-CoolStream RAD XT (240) EK-CoolStream RAD XTX (120) 
CoolingCoolingCoolingCooling
EK-CoolStream XE 120 (Single) 8x Corsair Air SP120 PWM High Performance Edition 3x Corsair Air AF120 High Performance Edition EK-Supremacy EVO CPU Water Block (Nickel Acetal) 
CoolingOSMonitorMonitor
EK-FC970 GTX WF3 - Acetal+Nickel Windows 10 64-bit v1511 build 10586.14 BenQ RL2755HM LG W2261 
MonitorKeyboardPowerCase
Samsung S23C350 Razer BlackWidow Ultimate Cooler Master Silent Pro Gold 1000W Thermaltake Level 10 GT 
Mouse
Razer Lachesis 5600DPI 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel 3930K 5040MHz @ 1.48 - 1.53v @ VTT/VCCSA ... Asus rampage extreme IV Gigabyte GTX 970 G1 @ 1580/4050MHz @ 1.325V Corsair Vengeance 64GB (8 x 8GB) DDR3 2400MHz. ... 
Hard DriveHard DriveHard DriveHard Drive
Samsung 850 Pro 256GB Seagate Barracuda ST3000DM001 3TB WD Black 1TB 64Mb Cache  WD Blue 500GB 16mb Cache 
Hard DriveOptical DriveCoolingCooling
WD Black 4TB 64mb Cache LG DVD EK-FB KIT RE4 - Acetal EK-FC970 GTX WF3 Backplate - Black 
CoolingCoolingCoolingCooling
Laing D5 Vario 12V DC Pump (MCP 655)  EK-BAY SPIN Reservoir - Plexi EK-CoolStream RAD XT (240) EK-CoolStream RAD XTX (120) 
CoolingCoolingCoolingCooling
EK-CoolStream XE 120 (Single) 8x Corsair Air SP120 PWM High Performance Edition 3x Corsair Air AF120 High Performance Edition EK-Supremacy EVO CPU Water Block (Nickel Acetal) 
CoolingOSMonitorMonitor
EK-FC970 GTX WF3 - Acetal+Nickel Windows 10 64-bit v1511 build 10586.14 BenQ RL2755HM LG W2261 
MonitorKeyboardPowerCase
Samsung S23C350 Razer BlackWidow Ultimate Cooler Master Silent Pro Gold 1000W Thermaltake Level 10 GT 
Mouse
Razer Lachesis 5600DPI 
  hide details  
Reply
post #3 of 13
Thread Starter 
Quote:
Originally Posted by Fantasy View Post

have you tried to uninstall the JDK and the SDK and then install it again?

Yeah, I've tried installing into different directories and drives. And regardless, I think it's something to do with the paths, because the script in the base SDK directory can reference directories below it, but directories below can't reference the base directory above it, if that makes sense.
post #4 of 13
Thread Starter 
Still looking for help on this.
post #5 of 13
Thread Starter 
Another bump frown.gif
post #6 of 13
stick quotation marks around any paths with spaces in.

eg "%java_exe%" -jar lib\archquery.jar

If I understand your query, then what's happening is the Windows command prompt is interpreting the spaces in the file / path names as a command and parameter seperator rather than a space character.

eg
c:\program files is being interpreted as run a command called "c:\program" with the parameters being "files", rather than run a program in "c:\program files".


Failing that, install the SDK to a DOS friendly location (eg c:\droidsdk\)
post #7 of 13
Thread Starter 
Quote:
Originally Posted by Plan9 View Post

snip

Actually, the line does have single quotes around it, and it needs to be on the outside of the flags to accept it. On top of that, the SDK is installed in a path without spaces. The only way I could fix the issue with that line was to put the whole path before the 'lib'.

The regular executable in the base SDK directory just flashes the DOS window, no error messages even when run through cmd prompt. I found two other executables a couple directories in (e.g. D:\android-sdk\tools\lib\ in my case) named the same way; those, on the other hand, actually say "Failed to execute tools\android.bat: The system cannot find the file specified."

Everything is obviously set up to work relative to its current position, but it's not being able to reference folders above it, even though the batch files are written to properly do so. I feel like the problem is stemming from some setting or erroneous behavior in my setup.
post #8 of 13
Quote:
Originally Posted by EfemaN View Post

Actually, the line does have single quotes around it, and it needs to be on the outside of the flags to accept it.
That shouldn't have the flags inside the quote otherwise you're concatenating the flags as part of the command path. However it sounds like what you're talking about is the quotes are being used to contain the string being assigned to the variable %java_exe% - which is competely different to what I was talking about.

this is all moot as anyway as you don't have spaces in your path names.
Quote:
Originally Posted by EfemaN View Post

The only way I could fix the issue with that line was to put the whole path before the 'lib'.
ahhh, then the batch file is path sensitive. You need to add cd c:\path\name somewhere in your batch before the %java_exe% -jar lib\archquery.jar
It might also pay to add the SDK bin directories to your %PATH% environmental variables.
post #9 of 13
Thread Starter 
I don't know why I didn't do this before, but here's what I believe is the relevant chunk of code before I did any modification:
Code (Click to show)
Code:
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF

set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar

for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a

This is the batch file supplied by Google in the SDK, and earlier in the script it does call 'cd /d %~dp0' to set the directory. It's weird, because the 'call lib\find_java.bat' works fine.

And I think whatever is causing this is also causing the executable in \tools\lib\ to be able to find the script in \tools\. Does that make sense?
post #10 of 13
Quote:
Originally Posted by EfemaN View Post

I don't know why I didn't do this before, but here's what I believe is the relevant chunk of code before I did any modification: Code (Click to show)
Code:
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar
for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
This is the batch file supplied by Google in the SDK, and earlier in the script it does call 'cd /d %~dp0' to set the directory. It's weird, because the 'call lib\find_java.bat' works fine.
And I think whatever is causing this is also causing the executable in \tools\lib\ to be able to find the script in \tools\. Does that make sense?

set java_exe= is incomplete. You need the path to java.exe (if java.exe is in %PATH% then you can get away with just putting "java.exe" in that line. Else you'll need the full path.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Trouble Starting Android SDK Executables