How Fix this error java/lang/Object.class) : major version 52 is newer than 51, the highest major version supported by this compiler [duplicate] - visual-studio

This question already has answers here:
Warning major version 52 is newer than 51, the highest major version supported by this compiler
(11 answers)
Closed 6 years ago.
This error display when deploy soluation
This message display when start virtualbox and every once start virtual say problem in device and restart it

Check your JDK, and try to change it for 'latest' at -> Visual Studio -> Tools -> Options ->Xamarin -> Android Settings.

You will get this error when first upgrading to Android SDK build tools v24 if you are not targeting JDK 8. For notes and various workarounds see: https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/
I have pasted some workarounds from the above link for your convenience:
Update to Java JDK 8, and then make sure that JDK 8 is selected in the Xamarin preferences:
Visual Studio: Tools > Options > Xamarin > Android Settings > Java Development Kit Location.
Xamarin Studio (on Mac): Xamarin Studio > Preferences > Projects > SDK Locations > Android > Java SDK (JDK).
Uninstall all Android SDK Build-tools versions 24 and higher via the Android SDK manager.
Set the AndroidSdkBuildToolsVersion MSBuild property to an earlier version. For example, if you also have version 23.0.3 installed, you could add the following line within the top <PropertyGroup> element in the Android project .csproj file:
<AndroidSdkBuildToolsVersion>23.0.3</AndroidSdkBuildToolsVersion>

Related

problems with flutter doctor

Windows Version (Unable to confirm if installed Windows version is 10 or greater)
Android toolchain - develop for Android devices (Android SDK version 33.0.1)
X Could not determine java version
Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (version 2021.3)
X Unable to determine bundled Java version.
[!] Android Studio (version 2022.1)
X Unable to find bundled Java version.
problems with flutter doctor

Cordova, building for android can not find gradle on Windows 10

Installed Cordova 10 through npm on Windows 10, and I have installed:
The correct Java JDK
Android Studio
In Android Studio => Settings menu, I have added SDK's for all the Android versions from 7 to 11 (API Level 24 to 30)
I have added environment variables to location of Android Studio in Path (... \Appdata\Local\Android\SDK)
I have added the ANDROID_SDK_ROOT and ANDROID_HOME environment variables to same location as above
I have downloaded gradle 6.7.1 and added D:\gradle-6.7.1 to both Path and GRADLE_HOME environment variable
Still(!) I can not manage to build a basic apk from Cordova sample build, getting the following message:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\XXX\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Users\XXX\AppData\Local\Android\Sdk (DEPRECATED)
Using Android SDK: C:\Users\XXX\AppData\Local\Android\Sdk
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
Had to add \bin to the gradle directory in Path environment variable, finally it works.

Cannot select Cordova Global on Visual Studio 2017

I have a cordova app on visual studio 2017. VS2017 uses Cordova 6.3.1 however I need to use Cordova version 7.1.0.
So I had to install cordova globally as specified in this link https://evothings.com/doc/build/cordova-install-windows.html
Then I opened config.xml from my project and went to change Toolset Name, but it shows "Global Cordova Version (not currently installed)"
Any help to fix this issue?
If you have already installed Node.js, you can install Cordova 7.1.0 by typing this in a command line interface window (cmd.exe):
npm install -g cordova#7.1.0
Now, because changing the CLI version is not as reliable as we would want, I suggest to follow these steps to create your new app in Visual Studio 2017:
Go to File > New > Project > Blank App (Apache Cordova)
Open config.xml in View Code mode and find this:
<vs:toolsetVersion>6.3.1</vs:toolsetVersion>
<engine name="android" spec="5.2.1" />
Replace with:
<vs:toolsetVersion>7.1.0</vs:toolsetVersion>
<engine name="android" spec="6.3.0" />
Where 7.1.0 is your globally installed Cordova version.
Select Device as target.
Now Build > Build Solution
Save, close and reload the project. When you access config.xml in designer mode you'll see Global Cordova 7.1.0 as the selected toolset.
In order to build you may need to use the external Android SDK Build Tools (API 26) instead of the ones provided by Visual Studio (API 25).
Use the Android SDK Manager to manage versions, no need to get Android Studio for this.
Remember to follow the guidelines from Microsoft when changing the CLI on existing projects. However I strongly recommend creating a new one and then importing your files and adding your plugins to avoid potential problems.

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