What went wrong:
Execution failed for task ':path_provider:compileDebugJavaWithJavac'.
Could not find tools.jar. Please check that C:\Program Files (x86)\Java\jre1.8.0_241 contains a valid JDK installation.
I changed gradle.properties, some files works by changing to org.gradle.jvmargs=-Xmx1024m
most of the files doesnt work.
please help
regards,
Your jdk path should resemble like this "C:\Program Files\Java\jdk1.8.0_241".
The path you've mentioned above is jre.
Also, I think you've recently changed your JAVA_PATH in your system or installed any other software to create JDK path in their installed director, which now conflicts with your old path.
Anyway, go to your Environmental Variables and check for the JAVA_PATH and PATH variables contain the correct jdk path or not.
Related
when i try to run an app written by others in a different PC in my android studio, i get this error message.
Invalid Gradle JDK configuration found. Open Gradle Settings
Use Embedded JDK (C:\Program Files\Android\Android2\jre)
Change JDK location.
I just want to run this in my AStudio and check the app. what is best and easiest recommendation..
Go to File > Project Structure and change JDK location to Embedded JDK You can use short key Ctr+Alt+Shift+S
After I updated to Android Studio 2.3, I haven't been able to use the embedded JDK. When I try to build the project, I get errors like this:
Error:The newly created daemon process has a different context than expected.
Java home is different.
Expecting: 'D:\Development\IDE\AndroidStudio\jre' but was: 'C:\Program Files\Java\jre1.8.0_121'.
Please configure the JDK to match the expected one.
Open JDK Settings
But the JAVA_HOME environment variable isn't defined, but I can still use the normal JDK any problems, so I don't believe that's a problem. Where does Android Studio find the JAVA_HOME that prevents me from using the embedded JDK?
I tried uninstalled the system JDK to get it to work, and I updated java, which lead to it pointing to the JRE. I then reinstalled the JDK and when I point to it, it works fine. But I want to use the embedded JDK. Any ideas?
I have tried setting JAVA_HOME in gradle.properties, as linked in comments, but it still shows the error.
The line I added was:
org.gradle.java.home=D:/Development/IDE/AndroidStudio/jre
It should make the embedded JDK work (and change JAVA_HOME in the IDE) but it doesn't. It still leads to the same error mentioned at the top of this post.
In the snippet it says jre, and that was because when I copied it, I had just uninstalled the JDK. Updating the JDK and Java resulted in JAVA_HOME being set to the JDK location, but it isn't defined as an environment variable. I tried deleting the JDK table in Android Studio's config folder, but it did not work.
And what it looks when I set the JDK to be the embedded:
Try to reset your path of your updated JDK. and check it again. May be it will help you. Also clear your android studio temp cache and all.
I fixed this issue by uninstalling all the jdk installation & updates then reinstall only one jdk and assure its env. variables
I do not have a solution but I have the same problem it happens as the android studio opens from java_home/jre thence all JVMs that will fork next will come from this path, while your system varible tells Gradle to get his java.exe from JAVA_HOME
I tried to make gradle read from jre but it falied also i tried to make android studio open from java_home/bin but it falid also
I had the exactly same issue with embedded JDK which was working on Android studio version 2.2.3 and when I updated then every time studio prompts JRE not found then I added system JDK path in project folder and now Whole Android studio hanging and I switched back to Android studio 2.2.3. It seems Android studio 2.3.1 is buggy release.
It seems ,There are some miss match of JDK version.
So Try this:
First Uninstall all Jdk/jre and Android Studio.
Clear temp/prefetch etc.
then Simply Install latest version of Android studio.
Remember: Don't install any other JDK/jre and make sure that your system have proper internet connectivity.All missing file automatically downloaded.
I had try this already and it was work for me .I hope it will also work for you.
I must say the AS has too many trouble in environment settings. There are some concepts we need to know.
AS default java runtime environment itself ,as shown below.
AS default java runtime environment itself.
System has another Java_home as shown below.
System's JDK version
Then problem is coming , what will happen when the system's JDK version doesn't match the AS's JDK version?
i.
java.lang.UnsupportedClassVersionError
ii.
gradle failure:certification ...
iii. There are some other error I couldn't remember now.
Solution:
If your AS update to latest version,you should update your Gradle to latest version,and make sure your system's JDK is match AS's JDK version. At least, your idk version update to more than JDK1.8.0. When you do all of this ,try to restart your AS ,if does works ,try to restart your computer.
Extra:
The proxy software has some influences when Gradle sync, if there are any tips about certificate ,try to close proxy software and try again.
I tried to change the location by the following way
Project Structure > SDK location > JDK Location > ...
But it always reverts to the old address saved in it.
It's not saving the new location entered in it.
Please help me to solve this issue
I had the same problem and it was because I had a whitespace (which I can see is your case) in my JDK path. Try changing your JDK path to something like C:\jdk_1.7.0
Install the 32 bit java version. Problem will be resolved
When Launching the Android Studio getting this exception every time and project is not run.
Error:Invalid Gradle JDK configuration found. Open Gradle Settings
Platform SDK does not point to valid JDK (/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home)
You need to edit your project structure to point to a valid JDK location.
From File -> Project Structure
Set SDK Location -> JDK location to a Valid JDK Location like C:\Program Files\Java\jdk1.7.0_75
I was having same kind of problem with my machine which has program files located on the network and Java_Home environment variable was pointing to the program files location which was on the network. I installed a local Java JDK and defined the JDK path in Java_Home environment variable. This worked for me.
Using HelpViewer local or try to Add or Remove Content from the VS2012 Help Menu always results in message:
The location you specified for installing Help content is invalid, or you do not have permission to access it.
I get the error using using VS2012 Update 3 as an admin, or using command line HelpViewer as admin.
So I think this is a 'specified location invalid' not a permissions problem. I check the registry, and
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.0 AppRoot is C:\Program Files (x86)\Microsoft Help Viewer\v2.0\
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.0\Catalogs ContentStore is C:\ProgramData\Microsoft\HelpLibrary2\Catalogs\
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.0\Catalogs\VisualStudio11\en-US catalogName is Visual Studio 2012 Documentation
And the MSHC and METADAT files are installed at C:\ProgramData\Microsoft\HelpLibrary2\Catalogs\VisualStudio11\ContentStore\en-US
There is a discrepancy: what is the CatalogName? is it "VisualStudio11" or is it "Visual Studio 2012 Documentation"?
I even tried to repair VS to fix. First I used Control Panel Programs to remove HelpViewer 2.0. then I repaired VS 2012. The removal removed the HelpViewer app and files, and the repair restored them. I don't recall and did not note (my bad) changes to registry. But same ugly issue.
There are few related posts on the Internet, but I cannot find complete definitive information about the registry settings in relation to content and exe location
I finally found the registry documentation for Help Viewer 2.0 at:
http://msdn.microsoft.com/en-us/library/hh500508.aspx
I solved the problem by Editing:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.0\Catalogs\VisualStudio11, setting the Key, LoactionPath, to the Value, C:\ProgramData\Microsoft\HelpLibrary2\Catalogs\VisualStudio11
Note that the .mshc, .mshi, .metadata files are located at:
C:\ProgramData\Microsoft\HelpLibrary2\Catalogs\VisualStudio11\ContentStore\en-US
In my case, I'm using Visual Studio 2019 Community Edition on Windows 7 and I have the same challenges when I configured my LocationPath previously to external drive and deleted it because I wanted to relocate it to C drive then, I got the same error messages; but I got the idea from here where it's located in Registry, so what I did is ... I remove this key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.3
re-install the Help Viewer from Visual Studio Installer and it works; now i have to download everything again from the Web through Help Viewer as I wanted newer and updated version.
I wish this solution could also help someone looking for answers to the same challenges. Good LUCK! ^_^
This issue might prevail even if you update registry keys, add CatalogType.xml, etc. I solved this as below.
The shortcut for Microsoft Help Viewer was pointing to
"C:\Program Files\Microsoft Help Viewer\v2.0\HlpViewer.exe" /catalogName VisualStudio11 /helpQuery method=f1&query=msdnstart /launchingApp Microsoft,VisualStudio,11.0 /sku 3000
Note the version 2.0 and /catalogName VisualStudio11. This was the problem. I corrected the version to 2.1 and /catalogName to VisualStudio12 and updated the shortcut. Things started working.
"C:\Program Files\Microsoft Help Viewer\v2.1\HlpViewer.exe" /catalogName VisualStudio12 /helpQuery method=f1&query=msdnstart /launchingApp Microsoft,VisualStudio,11.0 /sku 3000
Helpviewer needs some command line parameters to start and incorrect parameters caused this issue.
In my case the problem (The location you specified for installing Help content is invalid, or you do not have permission to access it.) was that I at some point renamed the folder where Help content was located:
(external disk) I:\10 INSTALL PROGRAMI\Visual Studio\Help Content = current path
I:\10 INSTALL PROGRAMI**MS** Visual Studio\Help Content = original path.
So, after renaming ... \MS Visual Studio... into ...\Visual Studio..., the path was broken.
As per above answer (from 'subsci' user, thank you), I modified the path in Registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Help\v2.1\Catalogs\VisualStudio12 -> LocationPath, and this solved the problem.
In my case (VS2019 Community Edition on Win10), the folder %ProgramData%\Microsoft\HelpLibrary2\Catalogs\VisualStudio15 was missing!
I created the folder but it still didn't work (complained that "A content file required by the Help Viewer is missing or has been corrupted"). I had to copy file "CatalogType.xml" from another version of VS i had on my PC to work. The contents of that file are the following:
<?xml version="1.0" encoding="utf-8"?><catalogType>UserManaged</catalogType>
Then Help Viewer 2.3 was opened and it just needed me to select the content to download.
In my case (VS2019 16.11.9) on my workstation I found that
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Help\v2.3\Catalogs\VisualStudio15 only had a key "VendorContent"=dword:00000001
I checked with my laptop (VS2019 help was working), and export the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Help\v2.3\Catalogs\VisualStudio15 branch, and imported the reg file on my workstation - problem solved.
This is the content of the exported reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Help\v2.3\Catalogs\VisualStudio15]
"LocationPath"="%ProgramData%\Microsoft\HelpLibrary2\Catalogs\VisualStudio15\"
"LastUpdated"="01/25/2022 20:01:00"
"VendorContent"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Help\v2.3\Catalogs\VisualStudio15\en-US]
"SeedFilePath"="C:\Program Files (x86)\Microsoft Help Viewer\v2.3\CatalogInfo\VS11_en-us.cab"
"catalogName"="Visual Studio Documentation"