Monday, June 4, 2018

Why daemon from Android Studio is not compatible for terminal?

Question Details:

If we use gradle clean build, it will create a daemon. On the other hand, if we clean or build through Android studio, it also generates another daemon.
So, How can we make daemons compatible?

Answer:
Actually, there are two main reasons to be incompatible.
  • One is version mismatch of Gradle and Java. Gradle version may be same but JDK versions are different.
  • By default, Android Studio is using embedded JDK, which most likely has a different version from Java installed in our machine.
How can we make daemon compatible?
If we use the local java in Android Studio instead of embedded JDK, this issue will be solved.

Procedure:

  1. In Android Studio, go to Project Structure -> SDK location.
  2. Uncheck “Use embedded JDK” and
  3. specify your local JDK.

Pictorial View is given below:

First Part:
enter image description here
Second Part:
enter image description here

No comments:

Post a Comment