linux: the complement with the identification & # 39; com.android.application & # 39; not found after Android Studio and Gradle updates

I recently updated Android Studio and Gradle. Now, when I open my project, I receive the Gradle sync error: The add-in with id & # 39; com.android.application & # 39; was not found.

I can't verify my version of Gradle with ./gradlew -v because it says I don't have JAVA_HOME, without ROUTE and without java command. But everything was fine before updating Gradle and Android Studio.

So, the question is what should I do to continue using Android stdio?