Some fixes for the new Android classpath version

This pull request contains some changes made by @dicej, @JustAMan and me in order to support the new Android classpath version.