check ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables
Go to PC properties -> Environment Variable -> Use variable for Your_User_name
Or
Control panel-->system --> search edit Environment Variable --> Environment Variable -> Use variable for Your_User_name
Add USED variable FOR Your_User_name-> Add New
Variable: JAVA_HOME
Value: C:\Program Files\Java\jdk1.8.0_221
Variable: ANDROID_SDK_ROOT
Value: C:\Users\Your_User_name\AppData\Local\Android\Sdk
C:\Users\kansiris\AppData\Local\Android\Sdk\build-tools\31.0.0\lib
Add following paths to the environment variable PATH:(system variables)
C:\Users\Your_User_name\AppData\Local\Android\Sdk
C:\Users\Your_User_name\AppData\Local\Android\Sdk\platforms
C:\Users\Your_User_name\AppData\Local\Android\Sdk\platform-tools
C:\Program Files\Java\jdk1.8.0_221
C:\Gradle\gradle-6.3\bin
C:\Users\kansiris\AppData\Local\Android\Sdk\
C:\Users\kansiris\AppData\Local\Android\Sdk\platform-tools
C:\Users\kansiris\AppData\Local\Android\Sdk\platforms
C:\Program Files\Java\jdk1.8.0_91\bin
C:\gradle-7.2-all\bin
Resolve! Could not find an installed version of Gradle either in Android Studio,
Last updated on: July 25, 2021
During installation and adding the Android platform to your Ionic application you may face the following issue in your terminal window:
[cordova] Could not find an installed version of Gradle either in Android Studio,
[cordova] or on your system to install the gradle wrapper. Please include gradle
[cordova] in your path, or install Android Studio
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
How to resolve this issue?
You need to install/ Download the Gradle setup and add it in your Environment Variables. Just follow these steps:
Step 1) Download Gradle files
Go to the Gradle release page and download the latest zip file. Which reads like gradle-6.2-bin.zip
Step 2) Extract this file and place in
C:\Gradle\gradle-6.2
Step 3) Copy path then add in Environment Variables
Open Environment Variables then add step 2 bin path to it.
That’s it now reopen terminal window to run Ionic commands to create productions files
Restart the system
Android Studio error "Installed Build Tools revision 31.0.0 is corrupted"
First of all, I face this issue in Android Studio 4.2.2 and you not need to downgrade the SDK build tool 31 to 30 or not to change compile SDK version.
The main problem is the two files missing in SDK build tool 31 that are
1. dx.bat
2. dx.jar
The solution is that these files are named d8 in the file location so changing their name to dx will solve the error.
The steps are below.
For Windows
go to the location
"C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0"
find a file named d8.bat. This is a Windows batch file.
rename d8.bat to dx.bat.
in the folder lib ("C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0\lib")
rename d8.jar to dx.jar
Remember AppData is a hidden folder. Turn on hidden items to see the AppData folder.
For macOS or Linux
# change below to your Android SDK pathcd ~/Library/Android/sdk/build-tools/31.0.0 \
&& mv d8 dx \
&& cd lib \
&& mv d8.jar dx.jar
Now run your project...
ANDROID_HOME
Deprecated (in Android Studio), use ANDROID_SDK_ROOT instead.
ANDROID_SDK_ROOT
Installation directory of Android SDK package.
Example: C:\AndroidSDK or /usr/local/android-sdk/
ANDROID_NDK_ROOT
Installation directory of Android NDK package. (WITHOUT ANY SPACE)
Example: C:\AndroidNDK or /usr/local/android-ndk/
ANDROID_SDK_HOME
Deprecated (in Android Studio 4.2), use ANDROID_PREFS_ROOT instead.
ANDROID_PREFS_ROOT
Location of SDK related data/user files.
Example: C:\Users\<USERNAME>\.android\ or ~/.android/
ANDROID_EMULATOR_HOME
Location of emulator-specific data files.
Example: C:\Users\<USERNAME>\.android\ or ~/.android/
ANDROID_AVD_HOME
Location of AVD-specific data files.
Example: C:\Users\<USERNAME>\.android\avd\ or ~/.android/avd/
JDK_HOME and JAVA_HOME
Installation directory of JDK (aka Java SDK) package.
Note: This is used to run Android Studio(and other Java-based applications). Actually when you run Android Studio, it checks for JDK_HOME then JAVA_HOME environment variables to use.
https://filehippo.com/download_java-development-kit-64/8-update-91/post_download/
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.