Utils.getSdkRootFromPath() is testing for the existence of adb AND emulator in each directory in the path to determine if it is the Android SDK tools directory. The problem with this is is that in newer versions of the Android SDK, adb has been moved to the platform-tools directory. It will never find adb inside the same directory emulator is.
I suggest adding a check for adb_has_moved.txt if you must use the tools directory to determine the availability of the SDK in the PATH.