adapted to work with latest android-gradle plugin