I'm trying to run an android application throw Visual Studio (7.4 Build 1033) and it seems that I'm having this problem :
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error MSB4044: The "AdjustJavacVersionArguments" task was not given a value for the required parameter "JdkVersion". (MSB4044)
And... I don't know how to solve this issue...
I saw that Visual Studio has the correct path to JDK (mentionned "Found" in the UI) and also the version of JDK is 1.8.
Any hints for helping me ?
Finally, I found the problem.
Visual Studio was using the JDK from Android Studio...
So I changed the path and begin to use the JDK that I installed with oracle (For instance (Mac) : ../Library/Java/...
To check the issue:
Preferences >> SDK Location >> Android
Here you will see the Location targeted for each, we are facing issue with JDK.
"usr/"
folder"libexec"
folder inside "usr/"
folder and look for "Java_Home"
"Java_Home"
, it will give you the location it is pointing toin the terminal window.In my case it was pointing to "/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home"
Now we know the location our VS is pointing to and we need to change this to required one. in my case "JDk 1.8"
"/Library/Java/JavaVirtualMachines"
"Contents/Home"
. Make sure once you select and come back to VS the green tick is all set.
The problem occurred on my machine after someone/something unexpectedly replaced JDK version 1.8 LTE with JDK 11 LTE. Seems that Xamarin is not compatible with any Java version except version 1.8.
Link to Microsoft Doc
Note that the version warning described in that article does not occur. Instead you run into the "AdjustJavacVersionArguments" error described above.
Having both versions installed in parallel seems to work fine, after I manually re-installed 1.8 and set the correct path to the JDK in Visual Studio (Tools-Options-Xamarin-Android Settings-Java Develoipment Kit Location") the error went away and I could successfully build and deploy my Xamarin projects again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With