Titanium Studio: package org.appcelerator.titanium does not exist

After updating to the latest 2.0.1 version of Titanium Studio, i got this error while trying to deploy my applications:

package org.appcelerator.titanium does not exist

import org.appcelerator.titanium.TiStylesheet;

Followed by a bunch of other errors related to missing Titanium libraries. And in the end, that’s just what it was. For some reason, Titanium Studio had set my SDK path to an invalid value. To fix this issue, go to Window -> Preferences -> Titanium and check that the Titanium SDK Home path is set to a correct value.

Titanium Mobile: java.net.UnknownHostException error when using the AVD emulator

Doing some local development with Titanium and I noticed that when using the xhr object to hit my localhost server (idxdot.dev), and testing using the emulator, I got this error:

(TiHttpClient-1) [7,236164] HTTP Error (java.net.UnknownHostException): idxdot.dev
E/TiHttpClient( 417): java.net.UnknownHostException: idxdot.dev
E/TiHttpClient( 417): at java.net.InetAddress.lookupHostByName(InetAddress.java:513)
E/TiHttpClient( 417): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)
E/TiHttpClient( 417): at java.net.InetAddress.getAllByName(InetAddress.java:242)
E/TiHttpClient( 417): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
E/TiHttpClient( 417): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
E/TiHttpClient( 417): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
E/TiHttpClient( 417): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
E/TiHttpClient( 417): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
E/TiHttpClient( 417): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:653)
E/TiHttpClient( 417): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637)
E/TiHttpClient( 417): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1017)
E/TiHttpClient( 417): at java.lang.Thread.run(Thread.java:1096)
I/TiHttpClient( 417): (TiHttpClient-1) [24,236188] Sending error idxdot.dev

I have idxdot.dev set up as a virtual host on my machine, and I can hit it fine doing my local development but not just from within the AVD and it hinted to me that it must be that the network setup in the AVD is not able to access my hosts file and apparently it’s because the address is used internally by Linux. A workaround is to use if you are using Linux or your local WAN/LAN address if you are on Windows (192.168.1.x).