[TIMOB-16] Via Tender: Newby - Error when launching android application
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:50:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 0.5 |
Components | Android |
Labels | android, developer |
Reporter | Jeff Haynie |
Assignee | Don Thorp |
Created | 2011-04-15T02:22:31.000+0000 |
Updated | 2011-04-17T01:50:07.000+0000 |
Description
Assigned to http://support.appcelerator.net/discussions/titanium-mobile-discussion/11-newby-error-when-launching-android-application"> Tender issue #11. As reported in Tender:
Just got my environment all set up with Android, when I attempt to launch a my newly created mobile android app I get:
Launching Android emulator...one moment Traceback (most recent call last): File "C:\ProgramData\Titanium\mobilesdk\win32\0.4.2\android\builder.py", line 315, in s.run_emulator() File "C:\ProgramData\Titanium\mobilesdk\win32\0.4.2\android\builder.py", line 69, in run_emulator "':d '" File "C:\ProgramData\Titanium\modules\win32\python\0.4.0\lib\subprocess.py", line 594, in init errread, errwrite) File "C:\ProgramData\Titanium\modules\win32\python\0.4.0\lib\subprocess.py", line 822, in _execute_child startupinfo) WindowsError: [Error 3] The system cannot find the path specified
I don't have any code yet - just tried to launch a blank application - which I did earlier for a desktop app and it ran.
Attachments
File | Date | Size |
---|---|---|
prereq.py | 2011-04-15T02:22:31.000+0000 | 1475 |
I've tracked this down (on Window's XP) to a failure in javac being run. If I change run(['javac','-version']) to run(['cmd.exe','/C','javac','-version']) in android/prereq.py javac is correctly detected if the jdk is on the path.
If you run prereq.py from the command line, it correctly detects java as well.
Looking at the python docs http://www.python.org/doc/2.5.2/lib/node528.html">POpen in 2.5 uses CreateProcess under the covers.
On Windows: the Popen class uses CreateProcess() to execute the child program, which operates on strings. If args is a sequence, it will be converted to a string using the list2cmdline method. Please note that not all MS Windows applications interpret the command line the same way: list2cmdline is designed for applications using the same rules as the MS C runtime.
From http://msdn.microsoft.com/en-us/library/ms682425%28VS.85">MSDN.aspx)
The string can specify the full path and file name of the module to execute or it can specify a partial name. In the case of a partial name, the function uses the current drive and current directory to complete the specification. The function will not use the search path. This parameter must include the file name extension; no default extension is assumed.
@Don
I am running on vista and getting this error as well.
I tried to make the change you specified but no dice.
Do I downloaded java but is there something I am missing?
I will be working on the fix and testing XP, Vista, and Windows 7. If it is easily patchable, I'll update instructions.
Sounds Great.
This error has me stopped in my tracks.
Thanks Don.
I've attached a replacement prereq.py that should work on 0.4.2.
If you still have an issue, then you might need to follow the clean up steps in http://support.appcelerator.net/discussions/support/54-android-emulator-stopped-working"> Android Emulator Stopped Working
Hello Don,
I am on Windows XP and using Titanium Mobile 0.4.2, i have replaced the prereq.py you supplied above but I am still getting this error.
Launching Android emulator...one moment
Traceback (most recent call last):
File "C:\Documents and Settings\All Users\Application Data\Titanium\mobilesdk\win32\0.4.2\android\builder.py", line 315, in
s.run_emulator()
File "C:\Documents and Settings\All Users\Application Data\Titanium\mobilesdk\win32\0.4.2\android\builder.py", line 69, in run_emulator
"':d '" File "C:\Documents and Settings\All Users\Application Data\Titanium\modules\win32\python\0.4.4\lib\subprocess.py", line 594, in init
errread, errwrite)
File "C:\Documents and Settings\All Users\Application Data\Titanium\modules\win32\python\0.4.4\lib\subprocess.py", line 822, in _execute_child
startupinfo)
WindowsError: [Error 3] The system cannot find the path specified
Any Ideas?
This problems also occurs here. Even after replacing the prereq.py.
Troy & Richard,
Did you also do all the steps in http://support.appcelerator.net/discussions/support/54-android-emulator-stopped-working"> Android Emulator Stopped Working
Don,
I am running windows xp. Which sqlite db do I need to clear? I am assuming it is for the Titanium Developer but I cannot seem to find where this is on windows.
Don,
I upgraded to 0.5.0 and still get this error on Titanium Developer running on XP when I launch the android emulator.
Launching Android emulator...one moment
Traceback (most recent call last):
File "C:\Documents and Settings\All Users\Application Data\Titanium\mobilesdk\win32\0.5.0\android\builder.py", line 315, in
s.run_emulator()
File "C:\Documents and Settings\All Users\Application Data\Titanium\mobilesdk\win32\0.5.0\android\builder.py", line 69, in run_emulator
"':d '" File "C:\Documents and Settings\All Users\Application Data\Titanium\modules\win32\python\0.4.4\lib\subprocess.py", line 594, in init
errread, errwrite)
File "C:\Documents and Settings\All Users\Application Data\Titanium\modules\win32\python\0.4.4\lib\subprocess.py", line 822, in _execute_child
startupinfo)
WindowsError: [Error 3] The system cannot find the path specified
Troy,
If you don't mind let's try removing Titanium from XP and starting with a fresh install.
delete C:\Program Files\Titanium Developer
delete "C:\Documents and Settings\All Users\Application Data\Titanium"
delete C:\Documents and Settings__YOURUSERNAME__.titanium
If you don't have any Titanium based apps with data then
delete C:\Documents and Settings__YOURUSERNAME__\Application Data\Titanium
_Ok some other test steps_
From the command line make sure you can successfully run
javac -version
You should have java 1.5.X or 1.6.X
echo %JAVA_HOME%
You should see the full path to the JDK directory, not the JRE directory. If you don't, set it in your environment.
Then try installing developer again.
Hi,
I tried removing Titanium, and re-installing. Trace log as follows:
Thank you for any other suggestions. Have not been able to get Titanium emulators working yet.
Jason S,
It looks like it is unable to locate the Android SDK. Were you prompted for
the SDK's location when you created your application?
Hello Don,
I removed Titanium and re-installed using the instructions for developing in Windows outlined in the CodeStrong documentation. Now the android emulator starts and the test mobile default application is already working. I think the problem had to do with setting the correct environment variables. In XP JAVA_HOME was not automatically set so I had to put it in manually. Thank you for your time.
Not sure why this has been so difficult for someone to get you a proper response... I don't know anything about Python, and I have no idea what this script is written to run in, but I found the problem and while not a solution, I found a "resolution" if you will.
if you can type javac -version and get 1.6.xxxxx then you don't need this script telling you there is a problem. what is wrong is the script is looking for "1.6" no more, no less. if javac -version reports back 1.6.0_21 (which is current JDK as of a couple of weeks ago, although JRE is at 1.6.0_24) then prereq.py will report it as an invalid version. edit the file, somewhere around line 17 you will see "1.6" in the file, change that to match what your javac -version reports back to you and you should be good. Well, at least until you update your JDK version... :P
if you need more help, I have written a blog post about it that, while a bit more confusing, shows you how to change this so it works, step by step, on linux, using VI as the editor.
http://bit.ly/gxpR6w">http://bit.ly/gxpR6w
hope this helps some, also if this is the resolution used to create the prereq.py file posted above, it might not be working for people, because their JDK is a newer version...