Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Xamarin Forms Android, Archive, ApkSignerTool compiled more recent version of the Java Runtime

stewa11stewa11 Member ✭✭
edited April 30 in Xamarin.Android

Publishing to Google Play using Visual Studio 2019, .Net standard 2.1, Xamarin Forms
Creating an Android Archive and on Distribute the signing process fails due to this error:

ApkSignerTool has been compiled by a more recent version of the Java Runtime(class version 53), this version of the Java Runtime only recognizes class file versions up to 52.0

Where do I check the versions?
Is there a fix please?

Thanks
Stewart

Best Answer

  • stewa11stewa11 Member ✭✭
    Accepted Answer

    OK sorted the immediate problem.
    Downloaded Version 14 of Java SDK and pointed Tools, Options, Xamarin, Java SDK at the installed directory.
    Hope it helps others.
    I hope too that there are no gotchas waiting for me... solve one problem create another.
    Best if MS could please provide a version that is based on a later version of the Java SDK from Oracle.

    Downloaded from here** https://www.oracle.com/java/technologies/javase-jdk14-downloads.html the exe v14, run the **jdk-14.0.1_windows-x64_bin.exe, install, accept the default directory.

Answers

  • stewa11stewa11 Member ✭✭
    Accepted Answer

    OK sorted the immediate problem.
    Downloaded Version 14 of Java SDK and pointed Tools, Options, Xamarin, Java SDK at the installed directory.
    Hope it helps others.
    I hope too that there are no gotchas waiting for me... solve one problem create another.
    Best if MS could please provide a version that is based on a later version of the Java SDK from Oracle.

    Downloaded from here** https://www.oracle.com/java/technologies/javase-jdk14-downloads.html the exe v14, run the **jdk-14.0.1_windows-x64_bin.exe, install, accept the default directory.

  • stewa11stewa11 Member ✭✭

    Yep found a gotcha. Installing Java Runtime v14 gets the signed APK, but once this is installed, it is not possible to Build the solution. Help! me please. :-)

    Severity Code Description Project File Line Suppression State
    Error Building with JDK Version 14.0.1 is not supported. Please install JDK version 1.8.0. See https://aka.ms/xamarin/jdk9-errors TraceCovidPeopleAds.Android

  • stewa11stewa11 Member ✭✭

    @stewa11 said:
    OK sorted the immediate problem.
    Downloaded Version 14 of Java SDK and pointed Tools, Options, Xamarin, Java SDK at the installed directory.
    Hope it helps others.
    I hope too that there are no gotchas waiting for me... solve one problem create another.
    Best if MS could please provide a version that is based on a later version of the Java SDK from Oracle.

    Downloaded from here** https://www.oracle.com/java/technologies/javase-jdk14-downloads.html the exe v14, run the **jdk-14.0.1_windows-x64_bin.exe, install, accept the default directory.

    I don't think this is an acceptable anwer. I think the acceptable answer is :smile:
    Microsoft, please provide a new version of their Java SDK that is based on a later version of the Java SDK from Oracle.

  • softlionsoftlion FRBeta ✭✭✭

    It does not work anymore, VS refuses to use jdk > 1.8. Removing android build tools 30.0+ fixed it.

  • stewa11stewa11 Member ✭✭
    edited October 21

    @softlion said:
    It does not work anymore, VS refuses to use jdk > 1.8. Removing android build tools 30.0+ fixed it.

    Sorry softlion but I continue using microsoft_dist_openjdk_1.8.0.25 for debug and jdk-14.0.1 to create a signed APK. I just switch between the two.

    It's OK when you get used to it.

    The 'error' happened when I started using Build Tools 29.0.2 and Android 10 (Q) with SDK Platform 29.

    Visual Studio 2019 Community. v 16.5.4

    Ohh! Also, I read there was a bit of falling out between MS and Oracle and it is for this reason VS doesnt implement anything later than ' jdk > 1.8'.

Sign In or Register to comment.