I have unity version 2022.3.12f1
I've added Facebook SDK into project and it started throwing errors when building. When i'm resolving Android dependencies - says it's resolved successfully. When building showing this window (Adding screenshot) and after this a few errors in console.
Errors(removed some repeating lines):
> Configure project :unityLibrary
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenLocal' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'BintrayJCenter' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenLocal' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'BintrayJCenter' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenLocal' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'BintrayJCenter' was added by build file 'unityLibrary\build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'unityLibrary\build.gradle'
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:compileReleaseAidl NO-SOURCE
> Task :launcher:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:mobilenotifications.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :launcher:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
> Task :launcher:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:mobilenotifications.androidlib:generateReleaseResources UP-TO-DATE
> Task :launcher:writeReleaseApplicationId UP-TO-DATE
> Task :unityLibrary:stripReleaseDebugSymbols UP-TO-DATE
> Task :launcher:analyticsRecordingRelease
> Task :launcher:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:copyReleaseJniLibsProjectAndLocalJars UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:packageReleaseResources UP-TO-DATE
> Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
> Task :launcher:extractDeepLinksRelease UP-TO-DATE
> Task :launcher:extractProguardFiles UP-TO-DATE
> Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:generateReleaseResources UP-TO-DATE
> Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:parseReleaseLocalResources UP-TO-DATE
> Task :unityLibrary:packageReleaseResources UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:processReleaseManifest UP-TO-DATE
> Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
> Task :unityLibrary:processReleaseManifest UP-TO-DATE
> Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:generateReleaseRFile UP-TO-DATE
> Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:compileReleaseJavaWithJavac UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:bundleLibCompileToJarRelease UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:mergeReleaseJniLibFolders UP-TO-DATE
> Task :unityLibrary:mobilenotifications.androidlib:mergeReleaseNativeLibs NO-SOURCE
> Task :unityLibrary:mobilenotifications.androidlib:stripReleaseDebugSymbols NO-SOURCE
> Task :unityLibrary:mobilenotifications.androidlib:copyReleaseJniLibsProjectAndLocalJars UP-TO-DATE
WARNING:Your project has set `android.useAndroidX=true`, but configuration `releaseRuntimeClasspath` still contains legacy support libraries, which may cause runtime issues.
This behavior will not be allowed in Android Gradle plugin 8.0.
Please use only AndroidX dependencies or set `android.enableJetifier=true` in the `gradle.properties` file to migrate your project to AndroidX (see https://developer.android.com/jetpack/androidx/migrate for more info).
The following legacy support libraries are detected:
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:appcompat-v7:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:appcompat-v7:25.3.1 -> com.android.support:support-annotations:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:support-v4:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:customtabs:25.3.1 -> com.android.support:support-compat:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:support-v4:25.3.1 -> com.android.support:support-media-compat:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:support-v4:25.3.1 -> com.android.support:support-core-utils:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:support-v4:25.3.1 -> com.android.support:support-core-ui:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:support-v4:25.3.1 -> com.android.support:support-fragment:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:appcompat-v7:25.3.1 -> com.android.support:support-vector-drawable:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:appcompat-v7:25.3.1 -> com.android.support:animated-vector-drawable:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:cardview-v7:25.3.1
releaseRuntimeClasspath -> project :unityLibrary -> com.android.support:customtabs:25.3.1
> Task :unityLibrary:mobilenotifications.androidlib:extractReleaseAnnotations UP-TO-DATE
> Task :unityLibrary:generateReleaseRFile UP-TO-DATE
WARNING:Your project has set `android.useAndroidX=true`, but configuration `releaseRuntimeClasspath` still contains legacy support libraries, which may cause runtime issues.
This behavior will not be allowed in Android Gradle plugin 8.0.
Please use only AndroidX dependencies or set `android.enableJetifier=true` in the `gradle.properties` file to migrate your project to AndroidX (see https://developer.android.com/jetpack/androidx/migrate for more info).
The following legacy support libraries are detected:
releaseRuntimeClasspath -> com.android.support:appcompat-v7:25.3.1
....
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
53 actionable tasks: 3 executed, 50 up-to-date
0x00007ff78d9fa2fd (Unity) StackWalker::GetCurrentCallstack
....
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.3.0-runtime (androidx.browser:browser:1.3.0) and customtabs-25.3.1-runtime (com.android.support:customtabs:25.3.1)
C:\Program Files\Unity\Hub\Editor\2022.3.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
Environment Variables:
....
stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.3.0-runtime (androidx.browser:browser:1.3.0) and customtabs-25.3.1-runtime (com.android.support:customtabs:25.3.1)
Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.3.0-runtime (androidx.browser:browser:1.3.0) and customtabs-25.3.1-runtime (com.android.support:customtabs:25.3.1)
Do you have any ideas how to fix this?
Looks like my web view package was conflicting with Facebook SDK. I was using web view package from Game Package Manager
. When I'm tried different package (tutorial, where I took it from: https://www.youtube.com/watch?v=5s4dATLDUOA), the problem disappeared