facebook-sdk-for-unity
facebook-sdk-for-unity copied to clipboard
Unity2019 Build Failed when set Target API 31
Environment
- Unity Editor Version: 2019.4.39f1 or 2019.4.40f1
- Facebook Unity SDK Version: 11.0.0 or 14.1.0
Goals
Build APK with Android Target API Level 31 Because this is PlayStore new app's requirement.
Actual Results
FAILURE: Build failed with an exception.
-
Where: Build file 'C:\WorkStation\TestAPI\Temp\gradleOut\launcher\build.gradle' line: 1
-
What went wrong: A problem occurred evaluating project ':launcher'.
Failed to apply plugin [id 'com.android.internal.version-check'] Minimum supported Gradle version is 6.1.1. Current version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl in C:\WorkStation\TestAPI\Temp\gradleOut\launcher\gradle\wrapper\gradle-wrapper.properties to gradle-6.1.1-all.zip
BUILD FAILED in 7s Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
CommandInvokationFailure: Gradle build failed. C:/Program Files/Unity/Hub/Editor/2019.4.40f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
-
Where: Build file 'C:\WorkStation\TestAPI\Temp\gradleOut\launcher\build.gradle' line: 1
-
What went wrong: A problem occurred evaluating project ':launcher'.
Failed to apply plugin [id 'com.android.internal.version-check'] Minimum supported Gradle version is 6.1.1. Current version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl in C:\WorkStation\TestAPI\Temp\gradleOut\launcher\gradle\wrapper\gradle-wrapper.properties to gradle-6.1.1-all.zip
Steps to Reproduce
Create a new project with unity 2019, import facebook unity sdk 11.0.0 or newest 14.1.0. Set Target API Level to 31 in player settings. I had already try this: https://developers.google.com/ar/develop/unity-arf/android-12-build Build APK via UnityMenu directly.
It will build success if i make project with unity 2020 or 2021 LTS. We still dont want to upgrade our old project to use Unity 2020 if there is a way to solve this.
Try exporting the project to Android Studio and use the Android Studio Gradle Upgrade Assist to make a new build with the latest gradle plugin.
Customize Gradle Installed Path Solved It.
@klpk can you describe your steps ?
Customize Gradle Installed Path Solved It.
You owe us some details how to solve it. Please add in this thread