File () { String androidSdkProp = System.getProperty("android.sdk"); File androidSdkPropDir = androidSdkProp == null ? null : new File(androidSdkProp); String androidHomeEnv = System.getenv("ANDROID_HOME"); File androidHomeEnvDir = androidHomeEnv == null ? null : new File(androidHomeEnv); String androidSdkRootEnv = System.getenv("ANDROID_SDK_ROOT"); File androidSdkRootEnvDir = androidSdkRootEnv == null ? null : new File(androidSdkRootEnv); if (androidSdkPropDir != null) { return androidSdkPropDir; } if (androidHomeEnvDir != null) { return androidHomeEnvDir; } if (androidSdkRootEnvDir != null) { return androidSdkRootEnvDir; } throw new RuntimeException( "Unable to get a valid path from 'android.sdk' property (" + androidSdkProp + "), " + "please point it to the android SDK location"); }