java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 in Visual Studio Xamarin [duplicate] - visual-studio

I am attempting to run a Hello World example from the following tutorial: https://mva.microsoft.com/en-US/training-courses/xamarin-for-absolute-beginners-16182
I am receiving the following error:
Severityjava.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 HelloXamarin.Droid
I have tried many combinations of JRE/JDK versions. I am uninstalled them, reinstalled them. I have tried JDK 7 and JDK 8. I keep getting this same exact no matter what combination.

You can follow this blog to resolve it https://agilehobo.wordpress.com/2016/08/24/2-ways-to-resolve-unsupported-major-minor-version-52-0-when-building-xamarin-android-app/

The solution not involving using Visual Studio IDE (i.e. build servers) is to import the following key to the registry after installing JDK version 1.8.0_101:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Novell\Mono for Android]
"JavaSdkDirectory"="C:\\Program Files (x86)\\Java\\jdk1.8.0_101"
Don't forget to clean/update sdks.cache files in obj[Release|Debug] directories to reference the correct version of jdk.
For the reference here is a complete list of paths used by Mono for Android:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Novell\Mono for Android]
"AndroidNdkDirectory"="C:\\ProgramData\\Microsoft\\AndroidNDK\\android-ndk-r11c"
"AndroidSdkDirectory"="C:\\Program Files (x86)\\Android\\android-sdk"
"JavaSdkDirectory"="C:\\Program Files (x86)\\Java\\jdk1.8.0_101"

I had a similar issue when Xamarin.Android project was moved from Xamarin Studio (Mac) to Visual Studio 2015 (Windows 10).
I resolved this issue after JDK 1.8.0_121 (for Widows x64) installation.

It worked also for me ONLY changing the registry entry

Related

ndk-bundle Not Found (GameMaker: Studio 2)

I downloaded the Android Studio and installed the ndk. GameMaker says no ndk was found. I tried to install the ndk separately but it didn't work either. What could it be?
Screenshot
Android Studio version 3.2.1
Sorry for my bad English
You will probably have to point to the specific NDK version directory such as C:\AndroidSDK\ndk\20.0.5594570\ instead of C:\AndroidSDK\ndk-bundle. Go to your C:\AndroidSDK\ndk-bundle directory and see which version of NDK you installed, and then post that directory to the IDE settings instead.

My newest Windows 10 SDK installation does not include rc.exe and rcdll.exe so I get LNK1158 error

I'm running Visual Studio 2015 Update 3, On Windows 10 Professional. I just installed the latest version of Windows SDK. I'm trying to compile a VC++ Console Application, very simple, but I cannot compile it because I get this error:
LINK: fatal error LNK1158: cannot run 'rc.exe'
I tried googling and I came up with this QandA but I can't find any rc.exe and rcdll.exe in my /kits/10/bin folder! Where could the problem lie?
If it matters, I installed the SDK version that came with the setup, and then installed the newest Windows 10 SDK that was on this ISO file:
17763.1.180914-1434.rs5_release_WindowsSDK.iso
I have read that rc.exe is no longer included in the Windows SDK. I had installed the oldest MSVC C++ compiler in the Visual Studio 2019 installer, but it did not contain rc.exe either. I installed the newest (which is also version 14, but with a higher minor version number!) and it contains rc.exe.

Qt 5.8 msvc 2015 compile error

I have installed Qt using an offline installer qt-opensource-windows-x86-msvc2015_64-5.8.0. I have visual studio community edition 2017 installed with c++ build tools. because it's compiler was incompatible with the qt version, then I installed visual c++ build tools 2015 from http://landinghub.visualstudio.com/visual-cpp-build-tools . When I try to compile a project it gives an error :-1: error: LNK1158: cannot run 'rc.exe'. Heres how my qt kit looks like,
Can someone figure out whats the mistake and how to fix it.
Thanks.
I've fixed this both on my own machine and on several co-workers machines.
It tends to happen when you have both Visual Studio 2015 and VS 2017 installed. Or more precisely, multiple versions of the Windows SDK installed. When that happens, the vcvars32.bat script (located in your Visual Studio install dir) does not correctly add the location of the resource compiler (rc.exe) to your PATH. Thus, QT Creator runs vcvars32.bat (as specified in Qt Creator under Option->Build&Run->Compilers, but the tools directory for the Windows SDK Kit isn't properly added to the PATH environment.
The simple fix is to add the appropriate version of RC.exe to your path.
Do this from the command line:
cd "c:\program files(x86)"
dir /s rc.exe
You'll get several versions (x86 and x64) and for several versions of the SDK. Add the PATH for where rc.exe lives for the version that corresponds to the SDK and build flavor to your vcvars32.bat startup script.
For example:
PATH="C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86";%PATH%
Restart Qt Creator and that should fix it.
Another fix that worked for me is to uninstall all versions of Visual Studio (and all those side installs of SQL, Windows SDKs, dev tools, etc...). Reboot. Then cleanly install VS 2017 again. Then cleanly uninstall and re-install all of Qt again. That seemed to work for me. A wonderful way to spend an afternoon.
If you update to Qt 5.9 it supports MSVC 2017. However, if you want to get it working with 5.8, I believe you might be missing the Windows SDK. You can download the SDK from Microsoft for Windows 7, 8 or 10, just get whichever version is appropriate for you.
With some googling I found a couple of other somewhat related solutions here, & here, and I've summed them up below:
If you've already got the SDK or installed it and it still doesn't work, it appears that copying rc.exe and rcdll.dll from the WindowsSDK folder to your MSVS installs \VC\bin folder may fix the problem. You might also try copying those same two files to Qt's \Qt*version number**compiler version*\bin.

Xamarin Visual Studio - Unsupported major.minor version 52.0

I am attempting to run a Hello World example from the following tutorial: https://mva.microsoft.com/en-US/training-courses/xamarin-for-absolute-beginners-16182
I am receiving the following error:
Severityjava.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 HelloXamarin.Droid
I have tried many combinations of JRE/JDK versions. I am uninstalled them, reinstalled them. I have tried JDK 7 and JDK 8. I keep getting this same exact no matter what combination.
You can follow this blog to resolve it https://agilehobo.wordpress.com/2016/08/24/2-ways-to-resolve-unsupported-major-minor-version-52-0-when-building-xamarin-android-app/
The solution not involving using Visual Studio IDE (i.e. build servers) is to import the following key to the registry after installing JDK version 1.8.0_101:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Novell\Mono for Android]
"JavaSdkDirectory"="C:\\Program Files (x86)\\Java\\jdk1.8.0_101"
Don't forget to clean/update sdks.cache files in obj[Release|Debug] directories to reference the correct version of jdk.
For the reference here is a complete list of paths used by Mono for Android:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Novell\Mono for Android]
"AndroidNdkDirectory"="C:\\ProgramData\\Microsoft\\AndroidNDK\\android-ndk-r11c"
"AndroidSdkDirectory"="C:\\Program Files (x86)\\Android\\android-sdk"
"JavaSdkDirectory"="C:\\Program Files (x86)\\Java\\jdk1.8.0_101"
I had a similar issue when Xamarin.Android project was moved from Xamarin Studio (Mac) to Visual Studio 2015 (Windows 10).
I resolved this issue after JDK 1.8.0_121 (for Widows x64) installation.
It worked also for me ONLY changing the registry entry

Error building sample driver: An SDK corresponding to WDK version '8.1' was not found

I used one Windows Driver samples from github (Filesys) and tried to build it on Windows 10 with Visual Studio 2015.
I have installed both:
WDK8.1 with its SDK
WDK10
But when i try to build a project i see this error message:
An SDK corresponding to WDK version '8.1' was not found. Please install the SDK before building. minispy (Filter\minispy) C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets
but SDK of 8.1 is already installed.
Is there any option in Visual studio that i could use to point it to SDK 8.1?
I had the same problem and the solution
is sdk version 10 released after VS 2015 .
You should download and install it manually. I used the following link for downloading sdk :
https://dev.windows.com/en-us/downloads/windows-10-sdk
Also see this link for help with downloading and installing sdk
http://blogs.msdn.com/b/jpwdkblog/archive/2015/08/21/windows-10.aspx
good luck
In this case, you may missed No.3.
Check following points:
Install Visual Studio 2015
Install Visual C++ (Not installed by default)
Install Windows SDK for Windows 10 (Not installed by default)
Install WDK 10 (Download separately)
Upgrade project from WDK 8.1 (for more detail: https://msdn.microsoft.com/en-us/library/windows/hardware/mt270257%28v=vs.85%29.aspx )
Currently,
Visual Studio 2015 supports WDK 10.
Visual Studio 2013 supports WDK 8.1.
In my environment, Visual Studio 2015 may not support WDK 8.1.
When build in WindowsUserModeDriver8.1 with VS2015, an error was occurred: prop is not found.
WDK 10 supports build drivers for Windows 10 / 8.1 / 8 (/ 7?).
(see also: https://msdn.microsoft.com/en-US/library/windows/hardware/dn914754%28v=vs.85%29.aspx )
To build Windows 8.1 driver, follow below.
Open project properties
Navigate to Configuration Properties > General
Check: Platform Toolset Windows****ModeDriver10.0
Navigate to Configuration Properties > Driver settings
Check: Target OS Version: Windows 8.1
Check: Target Platform: Desktop (Default: Universal)
You are likely targeting the wrong platform toolset. To build a driver for Windows 10, you need to target one of the Windows 10 platform toolset (WindowsKernelModeDriver10.0 or WindowsUserModeDriver10.0). If you want to use SDK 8.1, then you should use the WDK 8.1 platform toolsets (WindowsKernelModeDriver8.1 or WindowsUserModeDriver8.1).
You cannot use the 10.0 toolsets and try to make them point to SDK 8.1 because there were some key changes to how files are laid on disk between the two kits. Using the appropriate toolset should hopefully fix the issue!
Have you followed all the instructions during the installation of VS? https://msdn.microsoft.com/en-us/windows/hardware/dn913721.aspx
After correct installation I have handled the problem.
(Optional)
Did you install Windows 10 SDK?
Download link: https://dev.windows.com/en-us/downloads/windows-10-sdk

Resources