[AC-2897] Unable to select Android SDK directory
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2011-11-24T03:57:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Studio |
Labels | android, crash |
Reporter | Anthony J. Crowley |
Assignee | Paul Dowsett |
Created | 2011-11-11T06:40:44.000+0000 |
Updated | 2016-03-08T07:47:52.000+0000 |
Description
Android SDK Manager has been installed, and every version of the Android SDK downloaded through it.
Open Studio, Window->Preferences, Titanium Studio->Titanium.
Browse for Android SDK directory. If an invalid directory is selected, "Could not locate the Android SDK at the given path" message is displayed exactly as expected. When correct directory is selected (in this case, "E:\Android\android-sdk"), browse dialog closes, but text box does not update, and application is completely frozen.
I have encountered this issue on both computers that I've tried to set up Titanium Studio on, so it's not an issue that's isolated to a single computer.
Anthony Would you please follow the instructions at [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows), and post the results? Also, attach a screenshot of all the packages you have installed, shown in SDK Manager. Thanks
Sure thing:
!http://i.imgur.com/4Cuc3.jpg!
Anthony Thank you for doing that. Having inspected the results, I have noticed that there is an error in the script, where it changes to the
%ANDROID_SDK%\tools
directory and runs theadb
exectutable. However, Google moved this to%ANDROID_SDK%\platform-tools
some time ago, which begs the question, how is it running from there on your system? Would you check both directories to see where adb exists? Is the one in tools a symlink? ThanksYes, I noticed the error, but didn't know if something in Studio would be looking in %ANDROID_SDK%\tools, so rather than changing the test, I copied adb and the dll dependencies to tools and re-ran that test, but platform-tools is its original location.
Please delete the copies of adb and associated dlls from the tools directory, as they are not required. Thank you for bringing my attention to the script at [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows). I have fixed it now. Would you mind running it again on your system, after deleting tools/adb? Thank you
Note that we only support Python version 2.X.X. Please would you uninstall version 3 and replace it with this? See the [Installing Python](http://wiki.appcelerator.org/display/guides/Installing+Python) guide.
Done and done.
Anthony Sorry this is causing you so much grief. Would you try a couple of things for me, please? Firstly, close Studio, delete the android_sdk system variable, and launch Studio. Then try the process again. If this does not work, would you completely uninstall the Android SDK and then reinstall, ensuring that you have all (only) the packages shown in [Summary of Installed Android Packages](http://wiki.appcelerator.org/display/guides/Installing+and+Updating+Android+SDK#InstallingandUpdatingAndroidSDK-SummaryofInstalledAndroidPackages) (except that you will have the latest version of tools - 15 and 9 respectively). Cheers
Hey Paul, On my office computer at the moment. Put a clean install of Studio on, then installed Android SDK with only the packages shown in your link. Exactly the same problem. I'm pretty stumped at this point, does Eclipse of some kind of debug mode so we can see exactly where it's getting hung up? I'm only really used to using Eclipse as a dev environment, so am not familiar with some of the lower level features it offers.
Anthony OK, would you mind just doing the following on your office machine? This will help me prove an issue that is possibly affecting quite a few people at the moment: * start Studio and install the latest continuous build from the [master branch](http://builds.appcelerator.com.s3.amazonaws.com/index.html) (use the dropdown menu) of our continuous builds site, using Studio's *Help > Install Titanium SDK from URL* function. Note that you don't need to use this version (1.8.0.1) when compiling your apps - you just need it installed, as Studio will automatically use this for the python scripts as it is the most recent version on the system * restart Studio * try to configure the Android path again in Studio, being careful to click the apply button if necessary If this works on the office machine, try it on the first machine to verify the fix. Let me know how you get on. Thank you! :)
Done, this does not resolve the issue. Where is the Android SDK configuration info stored? I could try manually editing the config file, and see if that works.
OK, thank you Anthony. For the office machine, please would you follow the instructions at [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows) please? Note that the script has changed slightly since you last ran it.
Ok, here's the output from the script in a more or less as-is state:
There are a couple of things that jump out at me: * GIT isn't installed, that's because I told Studio to download and use PortableGIT on first launch * The Android tools aren't running, because they're in the platform-tools and tools directories respectively, they're not in the %PATH%, and we're not in the directory. Here's the output from them if they HAD run:
Let me know if there's anything else I can do.
OK, great, Anthony! I am glad you are still with me! ;) Points to note: * we don't officially support Java 1.7, as stated in [Installing Oracle JDK](http://wiki.appcelerator.org/display/guides/Installing+Oracle+JDK) * you should certainly configure the PATH variable with the
tools
andplatform-tools
directories, as stated [Installing and Updating Android SDK](http://wiki.appcelerator.org/display/guides/Installing+and+Updating+Android+SDK). This will allow adb and android to run when using the script, and can be much more convenient when developing Would you provide a listing (a screenshot is fine, if it's easier) of the following directories? *C:\Program Files (x86)\Android\android-sdk\add-ons
*C:\Program Files (x86)\Android\android-sdk\platforms
I will then compare these to my running system. ThanksHi Anthony Those directories are in the same format as mine, which is good. On Titanium Studio's *Preferences > Titanium Studio > Titanium* screen, at the top, it will state the location of your _Titanium SDK Directory_. Would you also provide a directory listing of this, in just the same way as you did above? Thank you
Oh, I am really sorry! I meant
C:\Users\kmccann\AppData\Roaming\Titanium\mobilesdk\win32
:/Note: note the previous edit - it's the win32 directory listing that I need. Apologies again.
...and in the versioned folder
This is indeed mystifying! Everything seems to be in the correct place. Even though I doubt that these are the cause, we will need to make sure the system precisely adheres to the recommendations by doing the following: * uninstall JDK 1.7 and replace it with 1.6, in line with ours and [Android's](http://developer.android.com/sdk/requirements.html) system requirements * add the android tools and platform-tools directories to the system PATH variable * run the [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows) script again. Everything should run without your intervention this time If there is nothing I can see wrong with the output, then there is one thing more we can try and then I will escalate this to our Engineering team Thanks again for your patience.
Same thing. Two completely different systems, which is really odd, but rules out it being a one-off glitch. I'm trying to work out what's common between them (other than the same OS). Antivirus is the same, but I've tried disabling that. Both are running several other versions of Eclipse (Flash Builder, Aptana), but I don't see why that would cause this problem. I'm completely stumped, hopefully we can get to the bottom of this though, happy to help, we're all developers here!
Anthony, your gracious spirit is appreciated! :) Would you run the following two commands at the command line (you should be able to simply copy and paste them):
Thanks
At home now, so slightly different paths, but there seems to be some problem with the output.
Anthony, it's only really possible for us to troubleshoot one machine at a time, I'm afraid, as there may be inconsistencies between them that could confuse the issue. Would you post the diagnostics output for this home machine, please? Thanks
Anthony - are you able to provide the above info? Thanks
Sure thing.
Thank you for that, but are the Titanium and Android SDKs in exactly the same locations on both machines? Which machine was that last output from? Also, I was requesting the output from [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows) for the home machine, if that is the one that we are now dealing with. Can we just deal with one machine from now on? Please tell me which one that is, and provide the output to the [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows) script, and the above python commands. Thanks
Note: this has been edited Would you please verify whether or not the following resources exist for the Home machine:
"C:\ProgramData\Titanium\mobilesdk\win32\1.8.0.1.v20111116130058\android\avd.py"
"C:\Program Files (x86)\Android\android-sdk\"
ThanksWould you please provide the [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows) output for the Home machine? Thanks
Hi Paul, I can confirm that those resources exist. Here is the diagnostics output:
On the home machine, please do the following: * remove java and JDK 1.7 * verify that the most recent JDK 32bit 1.6 is installed * verify that the PATH system variable includes the *
\path\to\javac
* * verify that JAVA_HOME system variable is correct * remove the system variable ANDROID_SDK * add *\path\to\adb
* and *\path\to\android
* to your system PATH * reboot machine Then run [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows) again and post the output. ThanksDone, here's the output. Side note - as you'll see from the output I'm still running JRE 1.7, but JDK 1.6. If you also need me to downgrade JRE, let me know.
Yes please, Anthony: * remove JRE and JDK 1.7 and 1.6 * install JDK 32bit 1.6, that includes JRE 1.6 * verify that the PATH system variable includes
\path\to\java
and\path\to\javac
* verify that JAVA_HOME system variable is correct * reboot * run [Install Diagnostics for Windows](http://wiki.appcelerator.org/display/guides/Installation+Troubleshooting#InstallationTroubleshooting-InstallDiagnosticsforWindows) and provide the output * post a screenshot of your Android SDK installed packages * provide the output from the following commands:Once this is done, then your environment is definitely set up "by the book". Thanks
Did you make any progress with this, Anthony? Thanks
I should be able to take a look at it tonight, I'll let you know. Cheers.
OK, Anthony, looking forward to it! ;)
Install diagnostics:
Python output:
Installed packages: !http://i.imgur.com/e2X7J.jpg!
Anthony For the Home machine: From the diag output, your environment seems to be configured correctly. However, the python commands did not produce any output. Do you know why this is? Do the filesystem locations used in the commands actually exist? Cheers
I was wondering about that too. I can confirm that both the python scripts, and the folders being passed to them as arguments do exist.
Just to confirm, the home machine is running 64bit Windows 7, isn't it? Would you please run the following two commands, to verify that they are working correctly? Both should output the usage statement.
Try this: * make a copy of the file,
ProgramData\Titanium\mobilesdk\win32\1.8.0.1.v20111116130058\android\avd.py
* edit the existingavd.py
file as follows: ** on line 21, changedebug=False
todebug=True
** runpython ProgramData\Titanium\mobilesdk\win32\1.8.0.1.v20111116130058\android\avd.py "C:\Program Files (x86)\Android\android-sdk"
again Post any output here. Then... * on line 22 (under the previous line you edited) ofProgramData\Titanium\mobilesdk\win32\1.8.0.1.v20111116130058\android\avd.py
, add the following:As it's python, indents are important - make certain that it's indented inline with line 23 (the one you moved down to make space for the print command) * run
python ProgramData\Titanium\mobilesdk\win32\1.8.0.1.v20111116130058\android\avd.py "C:\Program Files (x86)\Android\android-sdk"
again Post any output here. Thank youI'm really eager to get to the bottom of this issue for you, Anthony. When do you think you will have time to provide this information? Thanks
Anthony, I am marking this issue resolved. If you can provide the requested information, you are welcome to reopen it. Thank you
Hi Paul, I think I've had the same problem. I solved it by disabling the check for standard error output in run.py. I changed line 39 in run.py from if type(se) != types.NoneType and len(se) > 0: to if False and type(se) != types.NoneType and len(se) > 0: Now it can detect the android sdk an I can select the android version.
Caspar, the reporter has abandoned this ticket. Please raise a new one, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist). Thanks
Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) to ensure that we can escalate it quickly. Read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) if you have not read it before, and always start a ticket using the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template). Thanks in advance