0
votes

I am trying to generate .apk file for my angular application.

To generate apk used -
cordova build android

after some process it generate error.

I have also set user variables and system variables
ANDROID_HOME = C:\Users\user\AppData\Local\Android\Sdk
  JAVA_HOME = C:\Program Files\Java\jdk1.8.0_271
     PATH = ...;C:\Program Files\Java\jdk1.8.0_271\bin;
         C:\Users\user\AppData\Local\Android\Sdk\tools;
         C:\Users\user\AppData\Local\Android\Sdk\platform-tools

echo %JAVA_HOME% is printing => C:\Program Files\Java\jdk1.8.0_271
java -version => java version "1.8.0_271"
       Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
       Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
gradle -v => Gradle 5.6.3
cordova -v => 9.0.0 ([email protected])
cordova platform version android => Installed platforms:
                 android 9.0.0

Android Studio installed => 4.0.0

my error is

ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\user\AppData\Local\Android\Sdk (DEPRECATED)
Using Android SDK: C:\Users\user\AppData\Local\Android\Sdk
Requirements check failed for JDK 8 ('1.8.*')! Detected version: null
Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables
1

1 Answers

1
votes

New versions have some issues so after downgrading gradle and android version, I have restarted my system and again folowing this steps worked for me-
https://medium.com/@christof.thalmann/convert-angular-project-to-android-apk-in-10-steps-c49e2fddd29

as I was trying to create apk for angular app.