Just create local.properties with your sdk.dir in the module folder and then run gradle build.
You can also just set the ANDROID_HOME environmental variable to the sdk dir and that will work too
If you want to compile the latest XposedBridge, the link in libs is to
../XposedBridge/app/build/intermediates/packaged/release/classes.jar
so you can git clone --recursive, cd into the XposedBridge folder, and then run
gradle jarReleaseClasses. It should work fine. If you have another version of XposedBridge
just replace the symlink in libs.
Presentation here: https://docs.google.com/presentation/d/1pZGH-1g6Sz4DzryFmz0YQmSVAntfKsbsN8pHdhFfbww/edit#slide=id.p