android studio 1.1 preview 1 and ubuntu 14.10

A quick note. Because I’m on the Android Studio dev channel I pick up the latest (or near latest) “bleeding edge” releases for the developer builds. I tend to read the release notes before performing development installs, and this time was no different. This drop has a lot of bug fixes relative to the current release, 1.0.2, so I felt it was worth the risk.

Unfortunately, for whatever reason, it triggered the dread “aapt: error while loading shared libraries: libz.so.1” error message. It was amazing how I didn’t have that with 1.0.2, all the more so since I could have sworn on a stack of bibles I’d fixed that problem already and I was doing just fine with the older version and the Android SDK. The problem is simple enough. Open a console/shell window, and type “sudo apt-get install lib32z1” to load the 32-bit libraries on your Ubuntu 64-bit system.

There is really no excuse to keep running into this issue. It is not Ubuntu’s fault. This has been happening at least for the last two years, starting with Ubuntu 12.04 LTS (meaning the version of Ubuntu released April 2012), so it’s not as if someone at Google isn’t aware of it. And based on a quick Google search for the issue, it’s all over the forums. The majority of the world now runs on Ubuntu 64-bit, but then again, I suspect that the majority of Google’s internal developers still run on 32-bit Ubuntu, specifically 12.04, since that’s the version of Ubuntu (and Linux) Android Studio is guaranteed to run under. Come on, Google, get with the rest of the world.

There’s also a further heads up in the Android Studio release notes. Android Studio is still based on IntelliJ 13. Android Studio won’t officially move to IntelliJ 14 until Android Studio 1.2. Since I’m also an IntelliJ user, both 13 and 14 are equally good, so the decision to stick with 13 as the code base for one more release of Android Studio and to work on bug fixes is A Good Thing.

One More Thing

I have a Mac Mini now (a refurbished 2012 with 2TB of disk space, 4GB ram, and a quad-core i7) to run XCode and Swift on. I’ll be installing and trying IntelliJ’s AppCode IDE. AppCode 3.1 has support for Swift.

I’m not switching from Android to iOS, but adding iOS to Android. And Swift is the enabler for me. I’ve read Apple’s The Swift Programming Language (it’s free on iTunes) and I’m strongly motivated to give iOS serious effort. Before Swift there was only Objective C, and I hate Objective C.

updating to ubuntu 14.10

I upgraded to Ubuntu 14.10 in spite of my promise (to myself) to stick with Ubuntu 14.04 LTS (long term support) for the entire time it’ll be supported, which is five years. Biggest reason for moving to the next Ubuntu release is getting the latest (at that point in time) versions of core packages and applications, such as the kernel, gcc, Firefox, and LibreOffice, to name but four. The LTS installation still works just fine, but there are times where having the latest is needed; trying to backport the latest package releases to an older distribution release is pointless and fraught with errors when you can just step up to the next formal release.

It’s also a way to start over with a clean slate, getting ride of a multitude of older installation sins. For example, I’ve decided it’s not worth the hassle any more to try and make the old Apache dependent, PostgreSQL dependent Open Street Map service to work. I got tired of trying to iron out various odd wrinkles. Perhaps one day when I have more time I’ll create a dedicated OSM appliance, but for the time being I’m pursuing other lighter, less convoluted methods for creating a local map tile server. GeoServer looks interesting…

In order to accomplish my upgrade in a timely fashion I mounted the old Western Digital Blue 1TB notebook drive with Ubuntu 14.04 via a USB/SATA adapter to my notebook on its USB port (the Samsung R580 has four USB 2 connectors). That’s when I discovered that Ubuntu 14.10, out of the box as it were, would not mount a LVM that way, so I had to install lvm2 and perform the following special steps:

sudo apt-get install lvm2...sudo pvscan...sudo vgscan...sudo vgchange -a y...sudo lvscanACTIVE '/dev/ubuntu-vg/root' [927.37 GiB] inheritACTIVE '/dev/ubuntu-vg/swap_1' [3.86 GiB] inheritsudo mount /dev/ubuntu-vg/root /mnt/...

It would seem that all those steps are only required the first time, if at all. I found these steps on an old Ubuntu 12.04 how-to. I have a sneaking suspicion that if I had just installed lvm2, then re-plugged the drive in again that the software would have found and automatically mounted the LVM. I do know that when I had to go into the drive a second time that it did automatically mount the old LVM.

Once that was done I was able to move all my “sand box” work areas over to the new drive installation. I will note the following:

  • To transfer your working Android Studio work over, make sure to copy the .AndroidStudioBeta and .gradle hidden directories over along with everything else. Both contain considerable working configuration data, such as the state of your current open project and the cached version of Gradle that Android Studio is working with.
  • To transfer your working IntelliJ IDE environment, make sure to copy the .IdealC13 hidden directory as well as the .gradle hidden directory (see above as well).
  • To transfer your working Netbeans environment, make sure to copy the .netbeans hidden directory.
Android Studio Beta 0.8.9 transferred to Ubuntu 14.10
Netbeans 8.0.1 transferred to Ubuntu 14.10

Copying the work areas might take some time, but it takes far less time than trying to recreate by hand all relevant work environments. I also have everything I work on in specific top-level directories (so-called sand boxes), so that I can simply drag-and-drop those as well.

After 24 hours I’ve not had any issues or unpleasant surprises. Ubuntu 14.10 seems to be a very stable, more polished, and more up-to-date version of 14.04.01. If I ever need to go back to 14.04 I can simply swap the physical drives around and boot back up. All my tools are in place along with their configurations and it all operates as expected. That’s what comes with sticking with a given distribution; you learn its subtle nooks and crannies and how to quickly customize it to your needs. You know, little things like disabling search to Amazon, which seems to tie so many purist’s knickers in a knot.

The Samsung R580 is definitely growing long in the tooth. I’m curious to see if 15.05 will boot and enable all its hardware next April. I’ve been looking for the updated version of the R580 but haven’t found it yet.  Maybe I’ll discover something around Christmas time when the sales arrive…