Android AIDL regeneration

I’m working on a couple of Android projects; one has an Android IDL file (.aidl) for a service, and for some reason, the development environment didn’t automatically generate the corresponding .java file from it. I wasn’t able to figure out what caused this, and recreating the .aidl file didn’t fool the IDE into doing it, nor was I able to find a solution to this with the usual Googling.

I did find that right-clicking the project in the hierarchy and choosing “Android Tools” -> “Fix Project Properties” fixed this. Subsequent changes to the .aidl file automatically regenerated the .java file, too, so that’s nice.

12:37 pm — GeekeryComments (0)

Clearing apt-cacher’s cache

I frequently reinstall Ubuntu from scratch, so I’ve set up apt-cacher on my fileserver to cache the packages I install – this not only reduces my impact on the mirrors, but also speeds up my installs.

Occasionally, though, I see strange problems during installs: apt-get install retrying the download of an apparently-cached package. I haven’t figured out what’s wrong, and frequently I just want to get the reinstall going again. In these situations, it seems optimal to just dump the cache and start over; I haven’t found clear documentation of how to do this, but in case it isn’t obvious, this works for me (my cache is in /var/cache/apt-cacher, and I run it as www-data):

# Stop the service
sudo /etc/init.d/apt-cacher stop
# Move the old cache out of the way, so we can delete it 
# in the background (it can take a while)
sudo mv /var/cache/apt-cacher /var/cache/apt-cacher.old
sudo rm -rf /var/cache/apt-cacher.old &
# Make the new cache hierarchy, and set its ownership properly
sudo mkdir -p /var/cache/apt-cacher/{headers,import,packages,private,temp}
sudo chown -R www-data:www-data /var/cache/apt-cacher
# Restart the service
sudo /etc/init.d/apt-cacher start

Update: I found this blog post helpful for manually removing troublesome packages from the cache.

11:25 am — GeekeryComments (0)