Reputation: 1373
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 ?
Upvotes: 6
Views: 2400
Reputation: 2517
Reinstall JDK 1.8. MS Instructions
Visual Studio was pointed to JDK 1.8 but for some reason it was no good.
WARNING - make sure to fix the path to your jdk in visual studio. For me what I installed was a different version of 1.8 than the one I had previously. If Visual studio is still using the old jdk path it won't work. This should be obvious but for me it wasn't.
C:\Program Files\Java\jdk1.8.0_192 <-- old path. visual studio still thought this was good. good, that is, until build time.
C:\Program Files\Java\jdk1.8.0_201 <-- new path. from the install of JDK 1.8 that I did today. Tools > Options > Xamarin > Android Settings > Java Development Kit Location needs to be pointing to this.
Upvotes: 0
Reputation: 697
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.
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.
Upvotes: 1
Reputation: 327
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.
Upvotes: 1
Reputation: 1373
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/...
Upvotes: 5