Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Build APK Errorr! #256

Open
junglez07 opened this issue Sep 17, 2024 · 1 comment
Open

Can't Build APK Errorr! #256

junglez07 opened this issue Sep 17, 2024 · 1 comment

Comments

@junglez07
Copy link

I'm Using unity 2020.3.43f
Qonversion version https://github.com/qonversion/unity-sdk.git#8.1.1

When I build APK I have problem as : (I can't fix this bug) Please help me.Thank you so much!
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2020.3.42f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "E:\gradle-6.9.4\gradle-6.9.4\lib\gradle-launcher-6.9.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
USERDOMAIN = AS
ProgramFiles = C:\Program Files
TMP = C:\Users\lamdt\AppData\Local\Temp
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_REVISION = bf02
OneDriveConsumer = C:\Users\lamdt\OneDrive
OS = Windows_NT
ALLUSERSPROFILE = C:\ProgramData
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 191 Stepping 2, GenuineIntel
ProgramW6432 = C:\Program Files
USERPROFILE = C:\Users\lamdt
JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2020.3.42f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
CommonProgramFiles = C:\Program Files\Common Files
DriverData = C:\Windows\System32\Drivers\DriverData
ComSpec = C:\Windows\system32\cmd.exe
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC = C:\Users\Public
USERNAME = lamdt
NUMBER_OF_PROCESSORS = 20
USERDNSDOMAIN = AS.LOCAL
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
TEMP = C:\Users\lamdt\AppData\Local\Temp
Path = C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Java\jdk1.8.0_301\bin;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Users\lamdt\AppData\Local\Android\Sdk\platform-tools;C:\Users\lamdt\AppData\Local\Microsoft\WindowsApps;
COMPUTERNAME = AS-PC-33
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
OneDriveCommercial = C:\Users\lamdt\OneDrive - sharepoint
OneDrive = C:\Users\lamdt\OneDrive - sharepoint
SystemDrive = C:
windir = C:\Windows
FPS_BROWSER_USER_PROFILE_STRING = Default
ZES_ENABLE_SYSMAN = 1
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
APPDATA = C:\Users\lamdt\AppData\Roaming
HOMESHARE = \AS-DFS-01\Users\lamdt
PROCESSOR_LEVEL = 6
CommonProgramW6432 = C:\Program Files\Common Files
ProgramFiles(x86) = C:\Program Files (x86)
SystemRoot = C:\Windows
SESSIONNAME = Console
LOGONSERVER = \AS-AD-01
LOCALAPPDATA = C:\Users\lamdt\AppData\Local
HOMEPATH =
HOMEDRIVE = U:
USERDOMAIN_ROAMINGPROFILE = AS
ProgramData = C:\ProgramData

stderr[
Note: F:\Unity Game\iap_qonversion\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':launcher:checkReleaseDuplicateClasses'.

Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
Failed to transform moshi-1.14.0.jar (com.squareup.moshi:moshi:1.14.0) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.environment=standard-jvm, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for JetifyTransform: C:\Users\lamdt.gradle\caches\modules-2\files-2.1\com.squareup.moshi\moshi\1.14.0\df173a3bfa0bd9e0cd2a8fc14b24fc336dca0de0\moshi-1.14.0.jar.
> Failed to transform 'C:\Users\lamdt.gradle\caches\modules-2\files-2.1\com.squareup.moshi\moshi\1.14.0\df173a3bfa0bd9e0cd2a8fc14b24fc336dca0de0\moshi-1.14.0.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 60. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[

Configure project :launcher
WARNING:: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 7.0 of the Android Gradle plugin.
You will no longer be able to disable R8
WARNING:: Using flatDir should be avoided because it doesn't support any meta-data formats.

Configure project :unityLibrary
WARNING:: Using flatDir should be avoided because it doesn't support any meta-data formats.

Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:writeReleaseAarMetadata UP-TO-DATE
Task :launcher:generateReleaseBuildConfig UP-TO-DATE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :launcher:compileReleaseAidl NO-SOURCE
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:generateReleaseResources UP-TO-DATE
Task :launcher:javaPreCompileRelease UP-TO-DATE
Task :launcher:writeReleaseApplicationId UP-TO-DATE
Task :unityLibrary:packageReleaseResources UP-TO-DATE
Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
Task :launcher:analyticsRecordingRelease
Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
Task :unityLibrary:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:bundleLibResRelease NO-SOURCE
Task :unityLibrary:processReleaseManifest
Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
Task :launcher:generateReleaseResValues UP-TO-DATE
Task :launcher:generateReleaseResources UP-TO-DATE
Task :unityLibrary:generateReleaseRFile UP-TO-DATE
Task :launcher:mergeReleaseResources UP-TO-DATE
Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :launcher:extractDeepLinksRelease UP-TO-DATE
Task :launcher:checkReleaseAarMetadata
Task :launcher:processReleaseMainManifest
Task :launcher:processReleaseManifest
Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
Task :launcher:mergeReleaseShaders UP-TO-DATE
Task :launcher:compileReleaseShaders NO-SOURCE
Task :launcher:generateReleaseAssets UP-TO-DATE
Task :launcher:checkReleaseDuplicateClasses FAILED
Task :launcher:processReleaseManifestForPackage

Task :unityLibrary:compileReleaseJavaWithJavac

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9.4/userguide/command_line_interface.html#sec:command_line_warnings
28 actionable tasks: 8 executed, 20 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <50a1526ff8f740b3b328e418d1c6bca5>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action1[T] progress) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <50a1526ff8f740b3b328e418d1c6bca5>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <2cd7f07c7b884ea9bf02386eb91a464c>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

@SpertsyanKM
Copy link
Contributor

SpertsyanKM commented Sep 17, 2024

Hi, @junglez07. The error "Unsupported class file major version 60." is usually caused by the inconsistent JDK version. As I can see, you are using the old Unity version with the embedded JDK, which is of version 8. Please, consider upgrading Unity at least to the minimal supported version (2021.3) and JDK to version 11+ and everything should begin working.

The similar problem was discussed in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants