How to build Android project?

98 Views Asked by At

I have a well-functioning TFS build settings fro my projects which is works very well with my older android projects.

So recently I creted a new Android project, and I tried to build and create an apk with TFS, but I got an error when It started the unit test section, which says:

Failed to apply plugin 'com.android.internal.application'.

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options:

  • changing the IDE settings.
  • changing the JAVA_HOME environment variable.
  • changing org.gradle.java.home in gradle.properties.

In Android studio I checked, it is use the JDK 11, and in local I can build a release version from my project.

Unfortunatelly I don't have enough knowledge in TFS server builds, so I don't know what I have to do.

I can add more information, if it is helps, but please tell me what to attach

2

There are 2 best solutions below

0
Andreas1234 On BEST ANSWER

Finally I solved this.

Although I installed the latest java sdk, and I refreshed the JAVE_HOME environment variable, but I didn't restart the server. When I restarted, the build was successfully

0
Vidyesh Churi On

Set Gradle JDK to embedded(11.0.10) and same for environment variable.Go to Files>Settings> and search gradle and set jdk version.