As others found, it's a conflict that occurs when you have a newer version of Java installed, such as JDK 9.
This shouldn't really be necessary but here is a workaround: Create a new batch file with the below content (update paths as necessary). You want to set JAVA_HOME so it points to the older version of Java.
Xamarin.bat:
@echo off
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_161
set PATH=%JAVA_HOME%\bin;%PATH%
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\"
start devenv.exe
I recently get an old poject from a client. It was giving same error in Visual Studio for Windows. In Visual Studio for Mac it was giving 1 error without displaying any Error Message.
The reason behind the error was that the client have specified a signing key which is not available on my system.
On Mac I just have to uncheck the apk signing option.
while on Windows I have to edit the csproj file to remove the signing key. Now the project builds successfully.
In addition to JDK related answers above which is correct, also try to check PATH variable. There have to be latest installed JDK version. Solved my problem after days of checking different IDE's, machines and devices.
I got the same error when building a Xamarin.Android app on Visual Studio.
It was caused by having migrated my keystore from JKS to PKCS12 format because
keytool.exe -list -v -keystore <path to my keystore>
kept giving me the following Warning: The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format.
Bad idea to migrate, it appears apksigner.BAT requires the keystore be in the JKS format. I solved this issue by reverting back to my debug.keystore.old
As others found, it's a conflict that occurs when you have a newer version of Java installed, such as JDK 9.
This shouldn't really be necessary but here is a workaround: Create a new batch file with the below content (update paths as necessary). You want to set JAVA_HOME so it points to the older version of Java.
Xamarin.bat:
I recently get an old poject from a client. It was giving same
error
inVisual Studio for Windows
. InVisual Studio for Mac
it was giving 1 errorwithout displaying
anyError Message
.The reason
behind
theerror
was that the client have specified asigning key
which isnot available
on mysystem
.On
Mac
I just have touncheck
theapk signing
option.while on
Windows
I have toedit
thecsproj
file to remove thesigning key
. Now the project builds successfully.Try downgrading the JDK to 1.8.131.
i faced the problems with 1.8.161 and 1.8.162.
If u are using JDK 9, then downgrade to JDK-8
In addition to JDK related answers above which is correct, also try to check PATH variable. There have to be latest installed JDK version. Solved my problem after days of checking different IDE's, machines and devices.
Uninstalling JDK 9.x fixed it for me.
That Android Settings were pointing a JDK 8.x made no difference. JDK 9.x had to be removed to fix the issue.
I got the same error when building a Xamarin.Android app on Visual Studio.
It was caused by having migrated my keystore from JKS to PKCS12 format because
keytool.exe -list -v -keystore <path to my keystore>
kept giving me the following
Warning: The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format
.Bad idea to migrate, it appears
apksigner.BAT
requires the keystore be in the JKS format. I solved this issue by reverting back to mydebug.keystore.old