Whenever i try building my project i receive this :
"Failed to sign APK package.
CommandInvokationFailure: Failed to sign APK package.
C:\Users\FENIX\AppData\Local\Android\Sdk\build-tools\27.0.1\apksigner.bat sign --ks "F:/Farouk/Backupgames/user.keystore" --ks-pass pass:"password" --ks-key-alias "fenix" --key-pass pass:"password" "C:\Windows\Temp\SauceChase\Temp/StagingArea/Package.apk"
stderr[
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
]
stdout[
-Djava.ext.dirs=C:\Users\FENIX\AppData\Local\Android\Sdk\build-tools\27.0.1\lib is not supported. Use -classpath instead.
]
exit code: 1
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg)
UnityEditor.Android.PostProcessor.Tasks.BuildAPK.SignPackage (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.Tasks.BuildAPK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.HostView:OnGUI()
When i switch my build system to “Gradle(new)” the APK is signed successfully, however the game is full of bugs / ads aren’t showing etc and my google ads plugins get in conflict “Found conflicting Android library play-services-ads-license”.
using jdk1.8.0_151 and latest SDK version available.
List of things i have tried :
Downgrading JDK to version 8.
Set _JAVA_OPTIONS to Xmx512M / Xmx1G.
Signing the APK manually using apksigner.bat + Shell.
I’ts been already 2 days since i finished my first unity game but couldn’t fix this issue so i can upload it on app store.
Have you tried using other API level for android?
– jchester07