'assembleDebug' Task not Found While Running From Jenkins

If you're landing here while searching for this error in Android Studio: This error can also occur if one of the build.gradle files were updated via external means such as GIT. Android Studio may think it's in SYNC even if it isn't. Check that you have the correct build tools for the version you are compiling and then try the solution below:

Try clicking the Sync Project with Gradle Files


I fixed the "task 'assembleDebug' not found in root project" error by adding an ANDROID_HOME environment variable