I have this mistake for gradle im Android Studio.
Error:Invalid Gradle JDK configuration found. Open Gradle Settings
Platform SDK does not point to valid JDK (C:/Program
Files/Java/jdk1.8.0_31)
This is my JAVA_HOME: C:\Program Files\Java\jdk1.8.0_45
Why it is looking for older version of java?
Follow these direction:
In Android Studio: select File > Project Structure > JDK location. Specify the JDK to the folder of your currently installed JDK. And specify the SDK location as well.
Make sure your JDK/SDK are up to date..
Try to use Java 6 or 7, That will fix it.
Related
I am trying to build and generate an apk for my Ionic 4 application. When I attempt to do this, I am met with the following error:
A problem occurred evaluating project ':CordovaLib'.
[cordova] > No installed build tools found. Install the Android build tools version 19.1.0 or higher.
I have looked at many other solutions on Stackoverflow for this problem and nothing has fixed my issue. I have the Android SDK and SDK tools installed through the Android Studio SDK manager.
I have ANDROID_HOME set in both my .bash-profile and Android Studio path variables. Here is what my .bash-profile file looks like, which is where I believe environmental variables are intended to be set?
export ANDROID_HOME=~/Users/zacharyjordan/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Users/zacharyjordan/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
When I attempt to build my application, it doesn't even seem as if Ionic is detecting my updated ANDROID_HOME path. It lists ANDROID_HOME as ANDROID_HOME=/usr/local/Caskroom/android-sdk/4333796
If anyone knows what I can do to get my app to build properly I would greatly appreciate it. No other solutions on Stackoverflow have fixed my problem thus far.
I just troubleshooted this error on a coworker's computer and the problem was an environment variable called ANDROID_SDK_HOME that was set to a different folder (C:\Android in his case). Changing that variable to match the actual sdk folder fixed the issue.
First of all you get that because of your environment path is not correct.
What worked for me (Windows 10):
open Android Studio -> SDK Manager -> SDK Tools
☐ Hide Obsolete Packages
☑ Show Package Details
From Android SDK Build-Tools list
☑ 29.0.3
Set the PATH for the ANDROID_HOME to YOUR_PATH\sdk
I have the Android SDK and SDK tools installed through the Android
Studio SDK manager
SDK tools is different than the build tools.
Go to SDK manager, download build tools v19.1.0 or higher then error should be gone.
I managed to resolve my issue with the above error by creating 2 environment variables on my OSX machine for ANDROID_HOME this essentially is the same as what you did above but for my paths. (I had not done this prior.)
After that I ran the command sdkmanager "platform-tools" in my cordova projects CLI. I had difficulties resolving this issue before using Android Studios SDK Manager but this method seemed to clear things up.
Note: If build tools cannot be found for your project. It's worth trying sdkmanager "build-tools" in your CLI.
Hope this helps.
I fixed it by
export ANDROID_HOME=~/Android/Sdk
I have faced this error many times and fixed it also. But this time when I updated my android studio to the 2.2.2 and trying to load the project that was made on android studio 2.0 . Its giving me the following error.
and the path of the jdk is as and I have chnged tha following path to my valid jdk path but of no use.
Please tell me what shoudl I do . My studio is running well with all other projects but that project was made on android 2.0 and with other machine in our company.
Please help me I have stucked here for weeks
This error usually means what it says, you are trying to use a JRE instead of a JDK. The C:\Program Files\Android\Android Studio\jre folder is not the folder you should be using, you should be using the directory of a JDK installation (e.g. C:\Program Files\Java\jdk1.8.0_111). You will also need to set the JAVA_HOME environment variable to point at the same directory.
If you don't have a JDK you can download it from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
I try to programing in visual studio for android.
I install SDK , JDK ,Xamarin .Now I want set path of jdk to the visual studio but vs get message that :
Cannot find Java Development Kit files in specified path:
C:\Program Files\Java\jre1.6.0_07\bin
I set this path for Path and Home_java variable on the Enviroment Variable in SystemAdvanceSetting.
I use where javac in cmd but it can not find java path.
How to fix this?
Xamarin 4.1.2.18 and earlier doesn't currently support a 64-bit JDK. You should install a 32-bit version of JDK 1.7u79, which Xamarin will be able to detect. You can see which JDK Xamarin is using by clicking the Visual Studio menu Tools > Xamarin. You will see the listed JDK and Android SDK directories.
Xamarin.Android 4.1.2.18 and earlier also requires that a 32-bit Java JDK 7 (1.7) be
installed. Later versions of the JDK can also be installed alongside
JDK 7, if required by your machine.
You can use a 64-bit JDK 8 installation with the newer Xamarin 4.2 and later.
Your JDK path must point to C:\Program Files\Java\jre1.6.0_07, not to the bin directory.
Update your JAVA_HOME environment variable and try again.
I have downloaded and installed jdk 1.8, but when i try to set path to jdk 1.8 in ProjectStructure -> JDK Location, AndroidStudio ignored it, so after set path
click OK and reopen window "ProjectStructure" i see jdk 1.7 again
I deleted folder with java 1.7, and AndroidStudio open me dialog for specifing jdk-path, whehe i set it. Thank everybody for answering!
This seems to be a bug either in Android Studio 2.1.x or IntelliJ. Here is a workaround after you installed the new JDK and set it as JAVA_HOME env variable:
Close Android Studio
Go to %HOME%/.AndroidStudio2.1/config/options (or which version you are using)
rename/delete jdk.table.xml
start Android Studio again -> the JDK set in JAVA_HOME should be set as default jdk
Reference: https://code.google.com/p/android/issues/detail?id=213239
See also: Android Studio JDK location changes back to 1.7 every time it is updated to 1.8 path
Uninstall Java JDK7 and install JDK8, or set JDK8 as default Java VM in your OS.
I think you need to update your path variable and add your jdk location to it . Studio must be automatically getting path from your environment variable and replacing your path .
The JDK 1.8 does not seem to be fully supported by Android Studio because the Android platform does not support Java 8 as it is currently.
You can see this link for more information. Is JDK 1.8 fully supported by Android Studio?
use Android Studio 2.2 preview 7 version this only support java 8
Then you can use java 8 features :)
Just move your sdk folder to the small destination folder like C:/sdk. It seems that without setting your sdk folder you can't change the directory of the jdk folder.
When I boot up Android Studio and select "New Project..." and go through creating a new project, I get this popup error:
Failed to import new Gradle project: failed to find Build Tools revision 17.0.0
Consult IDE log for more details (Help | Show Log)
I would love to consult the IDE log, but I haven't even managed to get into the application to do much of anything. I've went through the preferences multiple times to see if I can set a path for the Build Tools, but I can't find much of anything. How do I fix this, or how do I get into the application without opening a project so I can at least see the logs?
After spending a few hours: I restarted the Android SDK Manager and at this time I noticed that I got Android SDK Platform-tools (upgrade) and Android SDK Build-tools (new).
After installing those, I was finally able to fully compile my project.
Note: The latest ADT (Version 22) should be installed.
As of May 2020, A really straightforward solution using Android Studio:
Open Android Studio
From the top, choose File > Settings > Appearance & Behavior > System Settings > Android SDK
click on the tab SDK Tools at the top. Then highlight Android SDK Build Tools from the list.
Check "Show Package Details" check box, choose the build tools version you need and then click Apply.
Look in the SDK Manager what is your highest Android SDK Build-tools version, and copy this version number in your project build.gradle file, in the android/buildToolsVersion property (for me, version was "18.1.1").
Hope it help!
This is what I had to do:
Install the latest Android SDK Manager (22.0.1)
Install Gradle (1.6)
Update my environment variables:
ANDROID_HOME=C:\...\android-sdk
GRADLE_HOME=C:\...\gradle-1.6
Update/dobblecheck my PATH variable:
PATH=...;%GRADLE_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Start Android SDK Manager and download necessary SDK API's
It happens because Build Tools revision x doesn't exist.
Today, the latest version is 23.0.2 (subject to change all the time).
The buildToolsVersions you want are included in the Android SDK, normally installed in the <sdk>/build-tools/<buildToolsVersion> directory.
Don't confuse the Android SDK Tools with SDK Build Tools.
Change in your build.gradle's buildToolsVersion to some version installed in <sdk>/build-tools
android {
buildToolsVersion "23.0.2"
// ...
}
Whenever you will try to run a project with build tool version not present in studio, You will face this error.
As of now in 2017, It has been made really simple by Android Studio.
It will prompt you about this issue, along with something like this
You just have to click on it and the system will download to the build version required to run the project.
I had the API 17 installed but that was not enough. What I really need installed is the "Android SDK Build-Tools 17".
You can locate your "Android SDK Build-Tools X" inside the first child, named "Tools", in the "Android SDK Manager".
in your Project perspective, look for Application --> build.gradle and edit this lines
android {
compileSdkVersion "android-N"
buildToolsVersion "24.0.0 rc1"
like this:
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
I had this problem recently, my project didn't include local.properties file.
Check local.properties file if it includes sdk.dir with correct path to sdk
i think you can download the latest android SDK and use it.i do this and fixed the problem and work well.
here is the link:
http://developer.android.com/sdk/index.html#download
Try to run gradle at the command line first. It might prompt you to setup and environment variable:
export _JAVA_OPTIONS="-Xms256m -Xmx1024m"
Read more here: 1, 2
Further make sure that the Android SDK build tools (adb, aapt, dx, dx.jar) are available in the PATH. If not you can create symlinks at the appropriate locations. They changed with the release of new SDK versions. Here is a shell script which creates the symlinks within the $ANDROID_HOME folder for you.
Basically error saying your are missing "Android SDK Build-tools" installed.
This worked for me after I tried many solutions:
For some reason the adb process didn't restart itself after installing new packages. Manually killing adb.exe and attempting to import the project another time solved this problem for me.
Uninstall the Android SDK Tools and then reinstall them from Tools > SDK Manager.