So, in trying to actually run Android Studio on a new machine, I’ve had to add a few more dependencies. You can see the original post here: Android Studio Under Debian. Now I am running Debian Testing, and came up against some more interesting missing dependencies after that when creating a new project. So if you get an error like so:
> /home/tbsliver/<snip>/app/src/main/res/drawable-xxhdpi/ic_launcher.png: Error: Cannot run program “/home/tbsliver/Development/android-studio/sdk/build-tools/20.0.0/aapt”: error=2, No such file or directory
Then you need to install a few extra packages. Elsewhere on the internet it will tell you to install ‘ia32-libs’, however these have been replaced with two other packages. So install them as so:
sudo apt-get install lib32z1 lib32ncurses5
And then you will also need one final package which you will get errors about otherwise:
sudo apt-get install lib32stdc++6
After that, it should work and run the Gradle commands nicely! hope this helps someone! (or just reminds me what the issues are later)
Hey long term readers! Just another short entry so that things I find useful to know are actually accessible to other people if they so need it. Today: Getting Android Studio to work in Debian (Wheezy).
So when I first ‘installed’ (read: unzipped) Android Studio, it wouldn’t start up – something about a .jar file missing:
‘tools.jar’ seems to be not in Android Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.
Which, as any programmer who encounters an odd error does, was promptly pasted into Google to see what other people had done about this. And really, there wasn’t a huge amount of things on it specifically, a lot of posts about needing to install the full Sun/Oracle JDK. Now, as I’m running Debian, that would mean changing the entire Java kit out from the OpenJDK that is currently installed… so I wondered – couldn’t I just install the OpenJDK Dev Kit? lo-and-behold, one simple aptitude install later and its all working – apart from an upgrade to Android Studio straight away… So, to get this working easily, and without any faffing about re-installing the entirety of Java, you just need to do this:
sudo aptitude install openjdk-6-jdk
Wait for it to finish, then re-try running Android Studio!
NB: I did find that the first time I ran it, the first menu screen didn’t render properly, but I think that may just have been a bug that was fixed in the update to Android Studio.
So for those of you who don’t know (which will probably be most of you…), I have started interning at Shadowcat Systems, where their philosophy (for new staff atleast) is to push you off a cliff, and see how long it takes for you to learn to fly. Currently im still falling, though slightly slower than before, which brings me to the main subject of this post: Tmux.
So, way back (ok so more like mid 2007/8) when I started messing in Linux for desktop and server based stuff, I had the need for keeping terminal’s open even when I was not connected to the server, and for having several open at one time. Now anyone who has used Linux for such purposes have probably used something called Screen – an exceedingly powerful window manager for the command line, though with a very steep learning curve, and (as i found ‘back in the day’) quite a difficult to understand config and use.
Fast forward to a few months ago, when I was first sorting out things with Shadowcat, and I realised that a lot of the time there I would be spending at the command line, and would have need for something quite similar to Screen. Remembering how little I liked said program, I had a look around, and happened across Tmux. Now dont ask me how I came across it, I really cannot remember the details, but all I know is that it makes sense. Ok, as with all command line interfaces and the like, there is always a learning curve, and I dont know how much of this I remembered from using Screen, but it clicked in and worked.
One of the major things I liked, was that there was a permanent statusbar, just like the taskbar seen in Windows/ Linux/ Mac/ insert OS here. I know that screen has the same option, but at the time I didnt know that, and having looked at some of the documentation for how to make that work nicely, I’m quite sure I would have just ran away screaming. Another function I liked was the ability to split windows into ‘panes’, and swapping between them quickly. Again, screen has this functionality (I think, somewhere….), but as before, being able to just pick it up and run with it is always a good sign.
The other major thing that I really like about it now, is how easy it is to customise it. I spent quite a while looking at tmux-powerline, which is a plugin of sorts that is designed to change the look of the statusbar, and update it with loads of quite useful functions. However, I really did not need all that extra stuff, and to be honest was quite confused about the ‘patched fonts’ – which relied on another related project’s documentation and files to work (the fact that the instructions linked to on the other projects documentation no longer exists, and when eventually found on ANOTHER related project, didn’t work either, did not bode well…). And anyway, these fonts were just for a few bits of visual flair… nice, but I felt was unnecessary, and was not going to work in my use-case either. The one major thing I liked about it, was the colour and the rough look of the bar, which I unceremoniously nabbed and then played with until I had what I am currently using.
As you can see, if you have taken a look at the powerline thingy linked earlier, the colours are quite similar. The one major difference though, is that this doesn’t need any shell scripts to run, and all is in the .tmux.conf file, which I can copy to any machine im working on which has Tmux, and have an environment that I am happy to use all day long. My Tmux config is below, and if anyone would like me to go through it, or have any questions about it, feel free to ask.
# Tmux Config
# Created by Tom "TBSliver" Bloor
# Provided as-is, do what you want with it.
# Usual not-my-fault disclaimer if something goes wrong
# after using this!
# Set Ctrl - a as the standard prefix, globally
set -g prefix C-a
# Unbind Ctrl - b as a shortcut so can use it for something else
# Bind Ctrl - a as the send-prefix command to stop confusion
# with vim or when using tmux in tmux
bind C-a send-prefix
# set the dafault delay to make tmux more responsive
set -sg escape-time 1
# bind r to reload this conf file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# set the terminal to use 256 colors
set -g default-terminal "screen-256color"
# set what the current active window status bar should look like
set-window-option -g window-status-current-format "#[fg=colour255, bg=colour27] #I : #W "
# set what the standard status format should be
set-window-option -g window-status-format " #I : #W "
## Set the text (fg) and background
set -g status-fg colour136
set -g status-bg colour235
# set the window status colors and attribute
setw -g window-status-fg default
setw -g window-status-bg default
setw -g window-status-attr dim
# set the pane borders and colors
set -g pane-border-fg colour136
set -g pane-border-bg colour235
set -g pane-active-border-fg colour235
set -g pane-active-border-bg colour136
# set the alert and tmux command line colors
set -g message-fg colour136
set -g message-bg colour235
set -g message-attr bright
# set the window list to centre
set -g status-justify centre
#set utf8 encoding
set -g status-utf8 on
# set the left side of the status bar to show the current active
# session, window and pane
set -g status-left "#[fg=colour234, bg=colour148] #S:#I.#P #[fg=colour0, bg=colour33] #H "
# set the right side of the status bar to show the current date and time
set -g status-right "#[fg=colour136, bg=color235] %a %d-%m-%Y | %H:%M "
# set tmux to monitor for activity in a window, and let the
# window list show activity in a window
setw -g monitor-activity on
set -g visual-activity on