So, I’ve been having a really hard time getting the Kitchen Sink app to load in an emulator using Appcelerator’s Kitchen Sink, I have been hacking away for 4 days now thinking I screwed up my installation guide I just spent 3 weeks working on, when I finally figured out some solutions! Now I cannot take complete credit for this, as I did get a lot of my information from developer.appcelerator.com/questions/created and appcelerator.lighthouseapp.com/projects/32238/tickets I have combined the results of 9 or 10 different posts along with some other tweaks I have made (and updated in my installation guide), and finally an astute observation on my part, to get this to work. So, if you have followed my guide then there is not too much more to do, if you are having this problem and did not follow my guide, then go ahead and give these fixes a try, then check out posts 1-4 with Ubuntu 10.10 32-bit and see if you missed anything.

Here is what I was receiving when I tried launching the kitchen sink before.


[INFO] Launching Android emulator...one moment
[INFO] Creating new Android Virtual Device (2 WVGA800)
[ERROR] Exception occured while building android project:
[ERROR] Traceback (most recent call last):
[ERROR] File "/opt/titanium/mobilesdk/linux/1.6.0/android/builder.py", line 1622, in
[ERROR] s.run_emulator(avd_id, avd_skin)
[ERROR] File /opt/titanium/mobilesdk/linux/1.6.0/android/builder.py", line 348, in run_emulator
[ERROR] avd_name = self.create_avd(avd_id,avd_skin)
[ERROR] File /opt/titanium/mobilesdk/linux/1.6.0/android/builder.py", line 318, in create_avd
[ERROR] inifilec = open(inifile,'r').read()
[ERROR] IOError: (Errno 2] No such file or directory: '/home/sdk/.titanium/avd/titanium_2_WVGA800.avd/config.ini
[INFO] Building KitchenSink for Android ... one moment
[ERROR] JDK version detected, but 1.6 is required

Very confusing output, I have been concentrating on the file line as my main issue, and the ADV errors I was hoping would resolve themselves afterwards. I made a few changes to my guide while trying to resolve this, nothing made it worse! hopefully some of it helped though!

***update on this (really only 45 minutes later), I have resolved most of this issue! I created several AVDs with the name and specifications that the emulator was looking for and the AVD launched the KitchenSink! here are the steps to resolve this issue! This requires some pre-configuration on your part to work, I’ll add notes for steps I remember this on.

  1. android – launches /opt/[android-sdk folder]/tools/android
    1. click new
    2. name=titanium_2_WVGA800 – change the number “2″ to what ever number is there in your DEBUG log [DEBUG] AVD ID: #
    3. give it an SD card of some size (I used 25MB)
    4. target set to whatever Google API you want to use (just make sure it is greater than or equal to 1.6)
    5. click “create AVD”
  2. go back to Titanium
  3. select kitchen sink under the projects column on the left
  4. click the edit tab
  5. change the Titanium SDK to 1.2 (not 1.6!!)
  6. now go to test & package
  7. set the SDK to any Android SDK
  8. change the filter to trace
  9. click launch

now try and launch the KitchenSink (my AVD loaded in less than 3 minutes, was not locked and my VM went up to 430MB of RAM and peaked at 45% and 100% on the two CPU cores). It seems the Titanium SDK 1.6 is causing all the issues. I figured this out when it struck me the version is 1.0 (Titanium default starting version)and the date is 2009, Titanium SDK 1.6 was just released, so it has to be the incorrect version!


So the next issue is the last line of the code output above: JDK version detected, but 1.6 is required
I’m still working on this one, so I’ll post it in another post a little bit later after I get it figured out, but right now the Emu is running, the apps in it run, and I think this will allow me and you to start coding!

*** update – I found the prereq.py script located in three locations (might be why when some users replaced it with the modified one in the forum it still didn’t work, as they put it in the wrong place!

  • /opt/titanium/mobilesdk/linux/[ver]/[platform]
    1. 1.6.0/android
    2. 1.6.0/iphone
    3. 1.2.0/android

first thing I did after finding nothing online when searching was to backup the file
sudo cp /opt/titanium/mobilesdk/linux/1.6.0/android/prereq.py /opt/titanium/mobilesdk/linux/1.6.0/android/prereq.py.bak && sudo cp /opt/titanium/mobilesdk/linux/1.6.0/android/prereq.pyc /opt/titanium/mobilesdk/linux/1.6.0/android/prereq.pyc.bak
and then I edited the file to try and fix it! I tried putting my $JAVA_HOME variable before the command “javac” but that returned no JDK installed instead of wrong version, so I tried putting the path to the jdk link in there (/opt/java/jdk-linked/bin/javac) and that returned this line:
JDK version 1.6.0_21 detected, but 1.6 is required
this told me right away that prereq.py is no longer valid and needs to be updated, again, slack programming by a “professional” development company, maybe they need to stop using their Unix wannabe Mac systems and actually use Linux… so I made another change to the file so that it was looking for exactly what it found (this could be dangerous, as it invalidates the check; however I have manually verified that everything is good, and my AVD runs fine at this point, so the only issue is that this python script is bogus. Someone who actually knows python can step in and tell me what I need to put if they would like).

  • sudo vi /opt/titanium/mobilesdk/linux/1.6.0/android/prereq.py – you may need to make changes if you are using windows or OS X to that location, and edit it with a different editor (do a find on the prereq.py file, that is what I did to find it)
  • 17G – using VI as your editor, this will jump you to line 17, the one we need to edit, it is the one that has javac on it and does not have cmd.exe (that would be the windows users line)
  • 9ww – that should skip you up to the “j” in javac
  • i – leaves command mode and begins edit mode inserting the cursor before the “j” in javac
  • /opt/java/jdk-linked/bin/ – the location to javac, if you did not follow my guide to set this up you will need to edit that line based off of where you installed the JDK, when in doubt do a find for javac
  • [esc] – that will take us out of edit mode and back into command mode (also moves the cursor back one space, never figured that out myself…)
  • 4j – that will move us down four lines to the “if not version.startswith…” line
  • use the “h” and “l” keys to move left and right until the cursor is on top of the 6 and type the following a.0_21[esc] – that should have changed the 1.6 to 1.6.0_21 (you should change this to what ever is displayed when you type “javac -version” from the command line!), for example my install is showing 1.6.0_21, therefore my entire line looks like this:
    • if not version.startswith(“1.6.0_21″):
  • :wq! – this will save the change and quit
  • sudo /opt/titanium/mobilesdk/linux/1.6.0/android/prereq.py – should not give that error anymore; it did however display the path to my android sdk home directory (/opt/android-sdk)
  • the prereq.pyc file is the compiled version of prereq.py, hopefully it will be updated automatically, but we made a backup earlier just in case.


    This next issue appears to have been resolved by one of the solutions I found above. I am posting it here anyway, in case someone else has run into issues with this and does a search, hopefully they will find this post as a resolution.


    [TRACE] wait_for_device returned: List of devices attached
    [TRACE]
    [TRACE]
    [DEBUG] /opt/android-sdk/tools/adb -e devices

    This just keeps repeating in the window over and over, I have let it sit for 30 minutes and it just keeps going about one repetition per second. If I re-click the “launch” button it does it maybe 4 times before building the kitchen sink, then it does some other things, builder.py line 803 – , line 622 – build and run, and line 112 – wait_for_device, then time.sleep(1) and KeyboardInterrupt and then it just stops there, if I re-launch it goes back to just repeating the above code, it is not a perfect loop, sometimes it will do the repeating over and over a couple of launch clicks in a row before going back to the builder.py lines.

    For what it’s worth, I get the exact same issue (with the same resolutions) if I create a new project and try to run it with Titanium’s SDK 1.6.0. Now one of the forum posts on developer.appcelerator.com stated that 1GB of RAM was not enough to use Titanium and that they have a 4GB win XP machine that normally uses ~2.6GB when they have Titanium running. so with out checking first, I shutdown my VM and bumped the RAM up to 2GB (from 1GB) and then started it up again and launched System Monitor, then tried building the KitchenSink and a blank new app called testapp1. My Linux Ubuntu 10.10 32-bit Virtual Machine with 2 CPU cores assigned, was using a whopping 201MB of RAM and the two cores were at 12.4% and 16.2% utilization. From this we can infer that either absolutely nothing is happening, or somebody is full of it. (I’m thinking the system is just sitting idle and not doing anything myself…).

    Now, I know that VM’s work better with less resources assigned to them, and only increasing those levels if the system is pushing it’s limits. So, I decided to cut it back to 512MB of RAM and 1 CPU core to see what happens (I also shut down the 3 other VMs I had running on my machine).

    *** solution – I believe that creating the AVD with the name that Titanium was looking for resolved this 3rd problem for me, as it is no longer occurring. Additionally, (and I have updated my installation guide to match) I have found that my Ubuntu VM runs about 450MB of RAM and 1 CPU core at 100% with another at >25% when the AVD is running. So, I have adjusted my VM to 768MB of RAM total (originally I was using 1GB, then I upped it to 2GB) and 2 CPU cores (no change there). I have not had any issues with maxing out those resources and so far the VM has used 0KB of swap.

    I have been having some other issues, and they will be coming in a follow-up post to this one (as a hint, I have resolved the libenchant error messages already, but detected another one in the meantime that I am still working on).

Part Three – Configuring Ubuntu to use your newly installed Java JRE and SDK
There are a lot of technical steps in this part, and I figured them out mostly through heavy internet searching, piecing together information from other blogs, and trial and error. The main issues were caused by every site expecting you to already have some key components installed before trying to get this working. So when I tried to follow their guides they never worked. That is why we are here now, using a fresh and clean Ubuntu installation.

updated for Java 7 on February 8th 2012

  1. cd /opt/java && sudo ln -s /opt/java/jdk1.7.0_02 /opt/java/jdk-linked && sudo ln -s /opt/java/jdk1.7.0_02/jre /opt/java/jre-linked – this moves back to the /opt/java directory and creates a link to the jdk folder that we can use to reference to later, that way if we ever install a newer version of java all you have to do is remove the links and create new ones, not have to go through this whole process again! you can test by typing cd jdk-linked && ls – and you will see the contents of /opt/java/jdk1.7.0_02 (don’t forget you can use [tab])
  2. sudo update-alternatives –install “/usr/bin/java” java “/opt/java/jre-linked/bin/java” 10 && sudo update-alternatives –set java /opt/java/jre-linked/bin/java – this updates Ubuntu so it can find your new jre and makes it the default jre to be used by the system (again future proofed because we used the linked location)
    • if you want to, we can setup java for Firefox too
    • mkdir ~/.mozilla/plugins/ && ln -s /opt/java/jre-linked/lib/i386/libnpjp2.so ~/.mozilla/plugins
  3. cd && vi .profile
    • [ctrl+f]
    • [o]
    • EXPORT JAVA_HOME=/opt/java/jdk-linked
    • [enter]
    • EXPORT PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin
    • [esc]
    • :wq!
  4. now we need to repeat the next set of instruction with the following items placed in [java] (everytime you see [java] put one of the following until you have done these steps for each of the following), I have noted after each one if you need a jre or jdk, or both lines for it, if both, replace the 10 with a 5 on the jdk (this will add both the jre and the jdk alternatives to the list making the jre ones the default). Or, just use this script. (remember to look at the script first to make sure it does what I said, and to set it as executable! cat java-update|more && chmod +x java-update then execute it with sudo ./java-update)
    • java – jre/jdk
    • jar – jdk
    • jarsigner – jdk
    • javac – jdk
    • javadoc – jdk
    • javah – jdk
    • native2ascii – jdk
    • rmic – jdk
    • rmid – jre/jdk
    • rmiregistry – jre/jdk
    • serialver – jdk
    1. sudo update-alternatives –install “/usr/bin/[java]” [java] “/opt/java/jre-linked/bin/[java]” 10
    2. sudo update-alternatives –set [java] /opt/java/jre-linked/bin/[java]
  5. mkdir ~/source-build && cd ~/source-build && sudo apt-get install debhelper gcj-4.4-base gcj-jdk m4 debiandoc-sgml python-docutils cdbs – moving on, we need to install some things before the adding Titanium to the system, this group (plus their dependencies, you don’t want to know what I went through to get this list exactly correct, it took a couple of months the first time I worked on getting this installed) takes up 823MB and took me 16 minutes to download and 2.5 minutes to install. as an fyi, I figured these out by not having them installed the first time around and spent weeks trying to figure each part out, because these files are not what causes the failed instal, linux will pull the dependencies for you when you install something, but there are dependencies of dependencies of dependencies… and somewhere down that line linux fails to grab the final set! So you need to install them in this order, I then spent another week or 2 finding out that those in particular have to be installed before the next set or the next set fails to install!
  6. sudo rm /var/lib/apt/lists/* && sudo apt-get update – this will resolve an issue with the sources of the next step
  7. sudo apt-get install llvm-gcc-4.5 && sudo apt-get build-dep llvm-gcc-4.5 && sudo apt-get -b source python-defaults ruby-defaults && sudo apt-get update && sudo apt-get dselect-upgrade && sudo apt-get autoremove – this set downloads the source files for each of these and builds them specifically for your system and then cleans itself up, this did prompt me for 62.5MB of additional storage space and the build process took about 20 to 45 seconds on my machine.
  8. sudo apt-get install ispell – I have found a few other things that are necessary for titanium to work
  9. restart your development VM
  10. mount your shared drives and take a new snapshot after the system comes back up, called pre Android SDK, and comments “OS, java jre&jdk, and compilers installed”

maybe you don’t really need all of this, but I don’t want to find out while I am writing my Android app that I missed a step, as then you won’t be able to re-use the snapshots in case of an emergency (also called a mistake!). One other note, if you noticed I made a new directory and used it for the source builds, this is because at least the python source build requires several chown commands to run and if you try to execute them on a VM share mount it will fail and you cannot complete the build. Congratulations! I know this was a tough part to do, and I’ll have to check it over sometime in the future to recreate the entire process step by step and make sure it all works again (never know where there might be a typo!). Next time we meet it will be to install the Android SDK and Titanium. After that we will build a short crappy Android app to test everything and then make an .iso Live CD of the whole VM! The final file was pretty big, I’m not sure if a Live DVD would cover it all! I’ll test this idea and add it to the final post if it works. I will be heading out of town for a couple of days so don’t expect anything before monday!

  1. part one
  2. part two
  3. part four

again, after I finish this series up, I’ll add in resource links

ok so to start, Appcelerator Titanium is still not working on either x64 or 32-bit Kubuntu 10.04.  I even found a video on YouTube on setting it up for Ubuntu 9.10 that had about 4 or 6 steps and took almost zero time, in fact he did it in an edited 10 minute video and did not install and dependencies or compilers… (gcc, gcc++, python, or ruby) on a clean OS install.  I am still not able to get it running.  I have a new weird error I have not been able to find helpful info on at this point.  will update this post early next week, I have a busy weekend ahead of me)

Final Fantasy XIII – still playing, found some things I am happy about, still not attached to my characters, although I care enough about my accessories that I want to complain that you don’t get them back when your party gets changed (which happens a lot).  I spent all my gil upgrading 1 weapon for each and 3 accessories, and I don’t always get a chance to un-equip the accessories before there is a party swap.  Also found a new thing that pisses me off!! THEY MADE UP WORDS TO THE CHOCOBO SONG!!! I can’t believe they stooped so low! (yes I know there was a pun in that statement)

Good news though, no 999hp limit (I know not the first FF to do so), damage is not capped at 9999 nor 99,999 (I believe, as the only not secret achievement in the game is do more than 100k damage in a single attack).  I am now in chapter 8 and have noticed a significant ramping up of CP rewards, and CP cost for new abilities.  I spent 4 hours at the level 7 sweet spot, Hope’s house, just run around inside and the soldiers respawn when you get halfway to the opposite side.  I made 125k gil from celling incentive chips (2.5k each) and got 60 phoenix downs and 25k CP.  not too bad a stash, but it was not enough… I could not buy any of the better upgrade components yet, so could only upgrade 1 item and 1 weapon (got Lightning’s starter sword to level 12, or maybe it was 11) and when I got to chapter 8 I was not able to max out anyone’s new CP skills. better yet! after I finished a relatively short and easy section wit h Sazh and Vanille (whom I always call vanilla) I had 33k CP available to upgrade the other team!!  which means that easy part at Nautillus which took about 45 minutes +/- gave me almost as much CP as 4 hours in Hope’s house… if I had known that, I would have stuck around Nautillus a bit more.

Right, on to my PC state of affairs… again, I have been using KUbuntu 10.04 for a week or two now, and have an installation post to make still, have it written on little scraps of paper that I need to type up, all seems good, Fedora 13 should be out tuesday, I have prepared my system for a clean install of that on a separate HDD.  Should get that done Wed, so there should be a post about that coming Saturday (maybe friday, I am going to try and post everything in the order it has been happening, so nothing gets left behind.  Also look out for a post on Sprint’s HTV Evo 4G sooner or later (might wait till I pick mine up on June 4th!!! although I will be out of town that weekend to watch a dance recital, 4 yr old and a 9yr old).  hopefully I will be posting my 32-bit Appcelerator install guide tonight if I can figure out this new error.  I want to get started on a couple system apps/widgets for my Evo before I get it.

Sorry for the exceptionally long title…

************************FAILED INSTALLATION, after approximately 3 hours of trying I give up**********************

**********update********

going to give it a shot on a 32-bit install tonight and see how that goes…

********end update********
Had a bit of an issue getting this to work, so I decided to put up a post, seeing as how some of the new fandangled Android phones launching this year will get some people interested in developing their own apps (and apple products too, this SDE is good for iPhone and Android currently…)  For this example, I am doing it as I type it, so hopefully I will come back and clean it up a bit later… I am creating a directory under ~/Downloads to both DL and save all the files used in this process.

*********************I had an error in this process, so I have documented it here.  make sure you read through to the end before trying, as I will re-post a working step-by-step guide at the end so you can avoid these errors…******************

step by step how I got this working (hopefully it will be working  when I finish!!)

  1. mkdir ~/Downloads/android/environment (makes the app directory, you can put it where ever you want, it will make a subdirectory when you do the download)
  2. sudo apt-get install build-essential ruby rubygems libzip-ruby scons libxml2-dev libgtk2.0-dev python-dev ruby-dev libdbus-glib-1-dev libnotify-dev libgstreamer0.10-dev libxss-dev libcurl4-openssl-dev git-core (this downloads all the dependencies you need)
  3. git clone git://github.com/appcelerator/titanium_desktop (this actually pulls down the application)
  4. cd titanium_desktop
  5. git submodule update –init (initiates an update I believe…)
  6. cd kroll
  7. git checkout master (really know nothing about git, I’ll have to look this one up…)
  8. cd ..
  9. scons debug=1 sdkinstaller run=1 (this actually builds the app and makes a binary for you to run)

after step 9 I got this error

/usr/bin/ld: cannot find -lPocoFoundation

collect2: ld returned 1 exit status

scons: *** [build/linux/runtime/libkhost.so] Error 1

scons: building terminated because of errors.

a little hunting found me this:

sudo apt-get install libPocoFoundation*

Reading package lists… Done

Building dependency tree

Reading state information… Done

Note, selecting libpocofoundation9-dbg for regex ‘libPocoFoundation*’

Note, selecting libpocofoundation9 for regex ‘libPocoFoundation*’

The following extra packages will be installed:

libpocofoundation9 libpocofoundation9-dbg

The following NEW packages will be installed:

libpocofoundation9 libpocofoundation9-dbg

0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.

Need to get 2,924kB of archives.

After this operation, 10.6MB of additional disk space will be used.

Do you want to continue [Y/n]? y

Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/universe libpocofoundation9 1.3.6p1-1 [525kB]

Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/universe libpocofoundation9-dbg 1.3.6p1-1 [2,399kB]

after which it proceeded to install those 2 packages…

collect2: ld returned 1 exit status
scons: *** [build/linux/runtime/libkhost.so] Error 1
scons: building terminated because of errors.

so I re-ran the install script to see what it might do…

same error… new tactic…

sudo ln -s /usr/lib/libPocoFoundation.so.9 /usr/lib/libPocoFoundation

ran it again…

same error… new tactic…

ls ./build/linux/runtime/

libcrypto.so.0.9.8          libgpg-error.so.0.3.0       libPocoCrypto.so.9      libproxy.so.0.0.0

libcurl.so.4.1.1            libgthread-2.0.so.0.2200.3  libPocoData.so.9        libsoup-2.4.so.1.3.0

libgailutil.so.18.0.1       libicudata.so.38.1          libPocoFoundation.so.9  libsoup-gnome-2.4.so.1.3.0

libgcrypt.so.11.4.4         libicui18n.so.38.1          libPocoNet.so.9         libssl.so.0.9.8

libgeoclue.so.0.0.0         libicuio.so.38.1            libPocoNetSSL.so.9      libwebkittitanium-1.0.so.2.15.1

libgio-2.0.so.0.2200.3      libicule.so.38.1            libPocoSQLite.so.9      libxcb-render.so.0.0.0

libglib-2.0.so.0.2200.3     libiculx.so.38.1            libPocoUtil.so.9        libxcb-render-util.so.0.0.0

libgnutls.so.26.4.6         libicutu.so.38.1            libPocoXML.so.9         webinspector

libgobject-2.0.so.0.2200.3  libicuuc.so.38.1            libPocoZip.so.9

so according to this the file might already be there? just with the wrong name…
next fix attempt…
sudo cp build/linux/runtime/libPocoFoundation.so.9 build/linux/runtime/libPocoFoundation.so
(also tried putting a .1 .2 .3 .4 .5 .6 .7 .8 at the end of it still no luck)
next thing I tried…
echo PATH=$PATH:/usr/lib
no good
but I did happen to find this…
/home/android-sdk/.titanium/runtime/linux/1.0.0/libPocoFoundation.so
which I added to /etc/environment and restarted the VM.
  1. sudo vi /etc/environment
  2. /PATH
  3. $
  4. i
  5. :/home/android-sdk/.titanium/runtime/linux/1.0.0/
  6. [esc]
  7. :wq!
just in case…
echo $PATH
showed what I wanted, so I re-ran the build…
same error.
:~/Downloads/android/environment/titanium_desktop/installer/linux$ cat SConscript
#!/usr/bin/env python
import os.path as path
just the first couple lines, but show that it is indeed using the system path, and I have 2 locations with the lib it is looking for in my path…
right new method… looking at the error it says
scons: *** [build/linux/runtime/libkhost.so] Error 1
well, that file does not exist in that location, so I am going to try and put it there…
sudo cp /home/android-sdk/.titanium/runtime/linux/1.0.0/libkhost.so .
no change, still same error.
starting to look like I will have to build my Android apps from windows…
well after 3 hours of trying to figure it out, I have had an idea…
~/Downloads/android/environment/titanium_desktop$ sudo scons debug=1 sdkinstaller run=1
exact same problem…
going to bed, I’ll probably post this now and make anew post later if I try again… 3+ hours to install 1 application is more than my patients will normally allow for a round 2…

To get updates…

  1. cd ~/Downloads/android/environment/titanium_desktop
  2. git pull
  3. cd krull
  4. git pull

**********reference link for this information, I just made it more specific and actually tried to do it using these instructions…

and the following other useful blog posts and such…

http://ubuntuforums.org/showthread.php?t=932162

http://www.linuxquestions.org/questions/linux-software-2/make-error-usr-bin-ld-cannot-find-lxext-365646/

http://ubuntuforums.org/showthread.php?t=204908

don’t forget to get the Android SDK!!!

15 visitors online now
3 guests, 12 bots, 0 members
Max visitors today: 26 at 11:53 am PST
This month: 26 at 02-09-2012 11:53 am PST
This year: 29 at 01-11-2012 02:49 pm PST
All time: 1100 at 08-08-2011 08:11 pm PDT
View in: Mobile | Standard