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

The launch is just around the corner #4078

Open
dyleeeeee opened this issue Nov 24, 2023 · 3 comments
Open

The launch is just around the corner #4078

dyleeeeee opened this issue Nov 24, 2023 · 3 comments

Comments

@dyleeeeee
Copy link

unity 2921.3.19f1
I applied AdMob, but the build keeps failing.

**Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :launcher
WARNING: The option setting 'android.enableR8=true' 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 /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)**

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

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':unityLibrary'.

Cannot change resolution strategy of dependency configuration ':unityLibrary:aarArtifacts' after it has been resolved.

  • 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 11s

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

CommandInvokationFailure: Gradle build failed.
/Applications/Unity/Hub/Editor/2021.3.19f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/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
HEAP_CLIENT_TOKEN_STAGING = 3786794399
__CFBundleIdentifier = com.unity3d.unityhub
AMPLITUDE_API_KEY_GREENBUCKET_DEV = 3ded2a762163603391a425f688f990c8
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
COMMAND_MODE = unix2003
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
AMPLITUDE_TOKEN_GREENBUCKET_PROD = yyzPzalJDwrQcYNuOZam0bhKb26WyyhK
LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283
XPC_SERVICE_NAME = application.com.unity3d.unityhub.10252412.10252418
ANDROID_NDK_ROOT = /Applications/Unity/Hub/Editor/2021.3.19f1/PlaybackEngines/AndroidPlayer/NDK
HEAP_CLIENT_TOKEN = 1717415662
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
USER = dong
MallocNanoZone = 0
LOGNAME = dong
__CF_USER_TEXT_ENCODING = 0x1F5:0x3:0x33
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a
PATH = /usr/bin:/bin:/usr/sbin:/sbin
LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282
SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.vv8oQWVTbE/Listeners
AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = e03a9bbe92dc38a88cdb068d24c65b46
AMPLITUDE_TOKEN_REDBUCKET_PROD = QqyoFpcWPi7V17p80_46CF6-sNGRGbHo
AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = Ph-837Q6GNodAkyc2MRkxVPUcjlIET4d
HOME = /Users/dong
TMPDIR = /var/folders/jz/wyw0lm7j1_lg7_19zh5d3k800000gn/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
BURST_ANDROID_MIN_API_LEVEL = 22

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

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':unityLibrary'.

Cannot change resolution strategy of dependency configuration ':unityLibrary:aarArtifacts' after it has been resolved.

  • 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 11s
]
stdout[
Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :launcher
WARNING: The option setting 'android.enableR8=true' 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.Action1[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.Action1[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)


Build completed with a result of 'Failed' in 161 seconds (160584 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ce] in /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindowBuildMethods.cs:193
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindowBuildMethods.cs:94
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

How should we solve this?

@escv12
Copy link

escv12 commented Nov 26, 2023

Try this :

Go project settings > player and turn on custom base gradle template

And Go Here : Assets\Plugins\Android\baseProjectTemplate.gradle
And Change "classpath 'com.android.tools.build:gradle:4.0.1'" to "classpath 'com.android.tools.build:gradle:4.2.2'"

And Go C:\Users\YourAppPath\Library\Bee\Android\Prj\IL2CPP\Gradle\gradle\wrapper > gradle-wrapper.properties
Change "distributionUrl=https://services.gradle.org/distributions/gradle-launcher-6.1.1.jar" to "distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip"

And go here "https://services.gradle.org/distributions/" and download "gradle-6.7.1-all.zip"

Unzip and replace the lib folder
"C:\Program Files\Unity\Hub\Editor\UnityVersion\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle > lib"

In my case, this worked.
I hope it helped you

@thiagolr
Copy link

Try this :

Go project settings > player and turn on custom base gradle template

And Go Here : Assets\Plugins\Android\baseProjectTemplate.gradle And Change "classpath 'com.android.tools.build:gradle:4.0.1'" to "classpath 'com.android.tools.build:gradle:4.2.2'"

And Go C:\Users\YourAppPath\Library\Bee\Android\Prj\IL2CPP\Gradle\gradle\wrapper > gradle-wrapper.properties Change "distributionUrl=https://services.gradle.org/distributions/gradle-launcher-6.1.1.jar" to "distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip"

And go here "https://services.gradle.org/distributions/" and download "gradle-6.7.1-all.zip"

Unzip and replace the lib folder "C:\Program Files\Unity\Hub\Editor\UnityVersion\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle > lib"

In my case, this worked. I hope it helped you

I'm not finding the gradle-wrapper.properties, do you have more information about it?

@escv12
Copy link

escv12 commented Nov 30, 2023

Then skip that step and try other steps.

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

No branches or pull requests

3 participants