OneSignal / OneSignal-Unity-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Other
222 stars 61 forks source link

[Bug]: No such property: VERSION_1_8x1 for class: org.gradle.api.JavaVersion #745

Open BIPIN02 opened 1 month ago

BIPIN02 commented 1 month ago

What happened?

When I set target API level to 33 your build is fine but when I set it to 34 your build fails. Gradle build failed. See the Console for details.

Steps to reproduce?

External dependency level is 1.77

What did you expect to happen?

need to build apk with target api level 34

Unity version

2021.3.19f1

OneSignal Unity SDK version

5..1.7

Platform

Android

Relevant log output

> Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at 

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/bipinchandra/Desktop/Bipin/Vikash/StaarSquare/StarSquare-main/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/build.gradle' line: 75

* What went wrong:
A problem occurred evaluating project ':unityLibrary'.
> No such property: VERSION_1_8x1 for class: org.gradle.api.JavaVersion

* 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

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

-----------------------------------------

CommandInvokationFailure: Gradle build failed. 
/Applications/2021.3.19f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/2021.3.19f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
AMPLITUDE_API_KEY_REDBUCKET_DEV = 46b8b46515e7632fc42a504b72e05fd0
DEBUG_ENV_VAR = UnityHub
XPC_FLAGS = 0x0
__CFBundleIdentifier = com.unity3d.unityhub
AMPLITUDE_API_KEY_GREENBUCKET_DEV = 3ded2a762163603391a425f688f990c8
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
COMMAND_MODE = unix2003
AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
JAVA_HOME = /Applications/2021.3.19f1/PlaybackEngines/AndroidPlayer/OpenJDK
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_DEV = client-wbjHYrmeSR87GmWOE7LDpf7sUySOIKHm
AMPLITUDE_TOKEN_GREENBUCKET_PROD = ZpUcbAdZXJYzNSoHsAWtL_s_JppwWid9
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
XPC_SERVICE_NAME = application.com.unity3d.unityhub.183256157.183256163
ANDROID_NDK_ROOT = /Applications/2021.3.19f1/PlaybackEngines/AndroidPlayer/NDK
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
USER = bipinchandra
MallocNanoZone = 0
LOGNAME = bipinchandra
__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a
PATH = /usr/bin:/bin:/usr/sbin:/sbin
SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.ebC5VnwOF5/Listeners
AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = e03a9bbe92dc38a88cdb068d24c65b46
AMPLITUDE_TOKEN_REDBUCKET_PROD = jTIgKs5KTZOjiqEEVdZFbgo_VRhABduL
AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = UYDQtPOw83dIfVy3SrW5oMyo7ru4PRkV
HOME = /Users/bipinchandra
TMPDIR = /var/folders/zg/679gz94s3r55l6wr70cf5cw00000gn/T/
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
AMPLITUDE_TOKEN_GREENBUCKET_DEV = 84H2gMm_FJzhr3mBaX1lM1JVukmCM7d9
AMPLITUDE_TOKEN_YELLOWBUCKET_DEV = wKi8foVigDditGFvmZewRFWsEbX9Y0YO
SHELL = /bin/zsh
AMPLITUDE_API_KEY_REDBUCKET_PROD = ca12bb461ea96f9bdf5df4ded7d52994
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_PROD = client-zH8Y7OK1i331EKuG77C6UxN8ygcM6LzS
BURST_ANDROID_MIN_API_LEVEL = 22

stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/bipinchandra/Desktop/Bipin/Vikash/StaarSquare/StarSquare-main/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/build.gradle' line: 75

* What went wrong:
A problem occurred evaluating project ':unityLibrary'.
> No such property: VERSION_1_8x1 for class: org.gradle.api.JavaVersion

* 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
]
stdout[

> Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <23ab6b9c559c4cda96c8ce953786e75a>: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 <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <23ab6b9c559c4cda96c8ce953786e75a>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:370)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

Code of Conduct

jkasten2 commented 1 month ago

This is the key parts of the build error log from above:

* Where:
Build file '/Users/bipinchandra/Desktop/Bipin/Vikash/StaarSquare/StarSquare-main/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/build.gradle' line: 75

* What went wrong:
A problem occurred evaluating project ':unityLibrary'.
> No such property: VERSION_1_8x1 for class: org.gradle.api.JavaVersion

The issue is something defined the Java version as VERSION_1_8x1 in your project which isn't valid. OneSignal does touch the unityLibrary/build.gradle file so something else must have modified it.

Check for any Java version overrides in your project and search for the string "VERSION_1_8x1" in all your project files. If nothing is found I recommend you restart Unity then do a clean build.