Still working on some of this, but I’ve been spreading comments across the web about having some of these issues resolved, so I guess I better post it and then update the rest later!

my next problem with Titanium so far (I have not even written one line of code and I’ve already spent 4 weeks trying to get it working! well actually that is not true, I wrote a helloworld java app using the VI editor and compiled and ran it before I even installed Titanium, to test my java install…). While Titanium is running I am constantly getting the following display repeated over and over in my terminal window.


*** Unable to locate valid config! Falling back to auto-detection...
*** Unable to locate PAC! Falling back to direct...

Now, I have no idea what any of that means, and before some idiot says “did you follow the directions on the Appcelerator website on preparing for java programming?” I want to tell you exactly what I think of the “directions” and where you can stick them! After following those wonderful directions, I wouldn’t trust the developers at Appcelerator to give me directions on how to use a drinking glass! And I think I’ll leave it at that, because there are kids out there somewhere on the net that might stumble across this post one day…

**** update – I’ve figured this one out, after viewing over 80 web pages with not much more than people complaining about this issue. A PAC is an internet proxy access auto-configuration file! For some idiotic reason Titanium seems to think that every use is connecting to the internet via a proxy server (I think Internet Explorer 5 and 6 were configured this way too!). I have checked my network settings and by default Ubuntu sets up to connect directly to the internet, so no PAC was ever created. there is a big thread on the support forum for this issue, running on Mac OS X 10.4. Just scroll down about 80% of the way (or search for this term “dropbox” it only shows up twice and both times are on the same comment), and you will see they custom made an SDK that disables the network proxy check, no idea if this will work on Ubuntu. Maybe I’ll test it tomorrow, it is only 2 months old… alternately, I am researching creating a “default PAC file” that will resolve this issue! give me another day or two and I should have it added on here.

The best info on this issue so far, if you feel like a good read, else, you can copy the info below or go see where I found it.

sudo vi /etc/proxy.pac
i – starts edit mode in insert
copy and paste the following, this code basically tells your computer “there is no spoon” and get over it!


function FindProxyForURL(url, host) {

// If URL has no dots in host name, send traffic direct.
if (isPlainHostName(host))
return "DIRECT";

// If specific URL needs to bypass proxy, send traffic direct.
if (shExpMatch(url,"*domain.com*") ||
shExpMatch(url,"*vpn.domain.com*"))
return "DIRECT";

// If IP address is internal or hostname resolves to internal IP, send direct.

var resolved_ip = dnsResolve(host);

if (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0") ||
isInNet(resolved_ip, "172.16.0.0", "255.240.0.0") ||
isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
return "DIRECT";

// If not on a internal/LAN IP address, send traffic direct.
if (!isInNet(myIpAddress(), "10.10.1.0", "255.255.255.0"))
return "DIRECT";

// All other traffic uses below proxies, in fail-over order.
return "PROXY 192.168.1.1:8080; DIRECT";

}

Now, you may want to change the IP on that last line to match your router (it will make things go faster…) as it will check that IP for a Proxy and if nothing is found it will connect directly. Now I need to figure out how to tell Titanium to use that file…


And on to the next issue I am having, during startup of Titanium I am receiving a number of errors, I’ll list a few word for word incase someone is googling the error message…


** (Titanium Developer:5705): WARNING : Error loading plugin: /usr/lib/enchant/libenchant_myspell.so: undefined symbol: enchant_get_dirs_from_param

** (Titanium Developer:5705): WARNING : Error loading plugin: /usr/lib/enchant/libenchant_ispell.so: undefined symbol: enchant_fopen

and it repeats that 8 times (at least it was 8 times when I checked it just now).

*****solution found.

  1. cd /usr/lib
  2. sudo rm libenchant.so libenchant.so.1
  3. sudo ln -s /usr/lib/libenchant.so.1.6.0 /usr/lib/libenchant.so && sudo ln -s /usr/lib/libenchant.so.1.6.0 /usr/lib/libenchant.so.1
  4. cd /opt/titanium/runtime/linux/1.0.0/
  5. sudo rm libenchant.so.1 && sudo ln -s /usr/lib/libenchant.so.1.6.0 /opt/titanium/runtime/linux/1.0.0/libenchant.so.1

that should fix your libenchant errors.


then this follows right after the libenchant issue…


(Titanium Developer:5705): DEBUG: NP_Initialize (Titanium Developer:2861): DEBUG: NP_Initialize succeeded
(Titanium Developer:5705): DEBUG: NP_Initialize (Titanium Developer:2861): DEBUG: NP_Initialize succeeded
(Titanium Developer:5705): DEBUG: NP_Initialize (Titanium Developer:2861): DEBUG: NP_Initialize succeeded
(Titanium Developer:5705): DEBUG: NP_Initialize (Titanium Developer:2861): DEBUG: NP_Initialize succeeded
** Message: console message: app://com.appcelerator.titanium.developer/js/entourage-jquery-3.0.js @36: TypeError: Result of expression 'C.getElementsByTagName' [undefined] is not a function.

I found a bug posting (click the link to see it) about this, it appears that the number after “Titanium Developer” varies and I do not get the email password error mentioned on that site. This bug is listed as new (marked Jan 6th 2011) and has no comments attached at this time. So I added my own comments to the post.


I found a new error in the trace logs while my AVD was running,
[ERROR] /opt/android-sdk/tools/apkbuilder
[TRACE] THIS TOOL IS DEPRECATED. See –help for more information.

I think it means depreciated… The only way to resolve this one would be for Appcelerator to update their code.


I found another issue while hunting the history of my terminal editor:


[Titanium.Host] [Error] Could not load module (/opt/titanium/modules/linux/python/1.0.0/libpythonmodule.so): "Error loading module (/opt/titanium/modules/linux/python/1.0.0/libpythonmodule.so): libpython2.5.so.1.0: cannot open shared object file: No such file or directory"

I did some digging, and this is most likely caused by a lack of Python2.5, I currently have python2.6. So I created a link from 2.6 to 2.5 so it could find it.

  • cd /usr/lib && sudo ln -s /usr/lib/libpython2.6.so.1.0 /usr/lib/libpython2.5.so.1.0

I have not seen that error since…

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 Two – installing the Java SDK
updated February 8th 2012

Let just get right into it! open up your terminal session and lets continue!

  1. mkdir -p ~/android/environment/system – this will make both the environment and system folders with one command (I love -p!)
  2. sudo mount -a && cd ~/Downloads && ls – make sure everything that should be there is actually there
  3. wget http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i586.tar.gz – 32-bit Linux java SDK (includes the SE/JRE version and bypasses clicking the I agree button to their terms…)
  4. sudo mkdir /opt/java && sudo tar xvfz jdk-7u2-linux-x64.tar.gz -C /opt/java/
    – remember to use [tab] after typing jdk so you can use this even if the version gets updated
  5. sudo apt-get install galternatives
  6. sudo rm /opt/java/*.bin – this will remove almost 200MB from your VM HDD
  7. and restart the VM again
  8. after the VM comes back up mount your shares again and take a second snapshot, we’ll name this one Java jre & jdk installed, in the comments note that you have also added galternatives

We will finish up part two here, the next section is where a little mistake will have you reverting to this last snapshot, so you will be happy we made it (I did not make the second snapshot the first time through and while all the way at the end of part three I had to revert back to the end of part one and redo this section again).

  1. part one
  2. part three
  3. part four
Tagged with:
 

right, so headed in a different direction with this post, I have made several updates/changes to my home computing setup since last I posted about it, and have decided it is time to do something about that. Currently I am setup and using the following:

PC components

external RAID enclosure

now not all of the HDD models are exact, I tried to pick the ones that were right, but I know I have one WD that ends in AACS, although that might be my 500GB PATA in my external WD case… The Radeon 4890 had a cooling fan failure so I replaced it with a 29.4 cfm case cooling fan that I epoxied onto the outer hard plastic cover (would not have fit inside anyway…) I think that ought to keep it cool… :)

ok, so all was purchased from Newegg.com except the video card, which I actually got on Craig’s list for $60 (he was asking $75 I believe) nice guy, also an HTC Evo owner and friended me on facebook, although that is the only time we have talked… Anyway, the Rosewill case and the 2TB HDD were holiday presents to myself in early Jan, the 1.5 TB I got last spring, the Radeon and 8GB RAM (upgraded from 4GB) I bought this past summer, most of the rest I got in may of 2009. Currently, the first list is what is in my case, the second list is all in the RAID enclosure (not running any for of RAID on the box, just using it so I do not have to keep the drives in the V9 for now). (getting used to these shortcuts on this cr-48 notebook, starting to enjoy using it more!)

Ok, so I am running Ubuntu 10.10 on the 250GB drive, with both mine and my wife’s home drives mounted from partitions on the RAID enclosure, my music folder is on the WD green 500GB drive, which is then bind mounted on to my wife’s music folder, so we share the same files (I’ve been working on setting up labels in Guayadeque (the music player I am using, more on that later) to separate out her music, so she doesn’t have to listen to mine on random play). The 500GB Black edition drive is my Windows 7 installation I Was using last year. Then ll my data is stored on the 2TB and 1.5TB drives, with the Virtual machines spread across the 1.5TB and the 2TB drives, I am looking into another 2TB drive to replace either the Win7 Drive or the other 500GB and to spread the VM’s a bit more as I am finding myself using at least 2 VMs that are on the same drive simultaneously. Although right now I am not having space issues, I am having CPU issues with frequent 100% 100% 100% 100% showing across all cores. The good news is AMD just dropped prices a little on their 6 core CPUs, hopefully that means they have a new family launching soon, I haven’t been keeping up with the news that much lately. If a new family is coming out this year (unless they are 8 core AMD CPU’s I’ll pick up a 6 core when the price goes down again (again my current MB supports 6 core phenoms, another selling point when I bought it), or I catch them on special on newegg. Right now the 1100 is $239, when it hits $199 I’ll snatch one up. That should give a nice boost to my VM’s, although at that point I might be running low on RAM and need to pick up another 8 or 16GB of DDR3 (thankfully my MB supports 32GB, although that was the deciding factor when I chose it).

Last on my upgrade list will be a 100GB BD burner so I can make an easily store-able backup of all my data (which by that time will be so outdated I could delete most of it…), by that time there should be 100GB Blue Ray discs, so it won’t take too many to do it. I’ll make two sets and mail one off to my parents on the other side of the country, any changes after that I could probably do an incremental on DVD’s…

17 visitors online now
1 guests, 16 bots, 0 members
Max visitors today: 22 at 12:58 pm 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