opened 08:53PM - 03 Feb 20 UTC
bug
## Checklist
- [x] I've updated to the latest released version of the SDK
- … [x] I've searched for existing [GitHub issues](https://github.com/facebook/facebook-sdk-for-unity/issues)
- [x] I've looked for existing answers on [Stack Overflow](https://facebook.stackoverflow.com), the [Facebook Developer Community Forum](https://developers.facebook.com/community/) and the [Facebook Developers Group](https://www.facebook.com/groups/fbdevelopers)
- [x] I've read the [Code of Conduct](CODE_OF_CONDUCT.md)
- [x] This issue is not security related and can safely be disclosed publicly on GitHub
## Environment
- Unity Editor Version: `2019.3.0f6`
- Unity SDK Version: `7.18.0` and `7.18.1`
- Installation Platform & Version: `[Android]` version `any`
- Firebase SDK Version: 6.10.0
- Unity Jar Resolver Version: 1.2.135
## Goals
Build the project
## Expected Results
Project is successfully built
## Actual Results
Project is failing to build with the following output:
```
CommandInvokationFailure: Gradle build failed.
/Applications/Unity/Hub/Editor/2019.3.0f6/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2019.3.0f6/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.0.2)
Go to the documentation to learn how to Fix dependency resolution errors.
```
## Steps to Reproduce
1. Create new unity 2019.3.0f6 project
2. Set project build target to Android.
2. Import Facebook SDK 7.18.0
3. Import the latest [Firebase Analytics SDK 6.10.0](https://firebase.google.com/download/unity) into the project.
4. Import [Unity Jar Resolver v1.2.135](https://github.com/googlesamples/unity-jar-resolver/releases) into the project.
5. Enable mainTemplate.gradle (Player settings -> publishing settings -> check custom gradle template)
6. Click Assets/Play Services Resolver/Android Resolver/Resolve
7. Enable Jetifier when prompted
8. Build the project
OR
1. Download and open the [repro project](https://drive.google.com/file/d/1ngzavtEftODND1EpRyNchq3qClpyXl0C/view?usp=sharing) I made.
2. Change build target to Android
3. Build the project
## Code Samples & Details
If I build with just Facebook SDK, it works.
If I build with just Firebase SDK, it works.
If I build with both Facebook SDK and Firebase SDK, it fails.
I made a Repro project following the steps I mentioned before.
https://drive.google.com/file/d/1ngzavtEftODND1EpRyNchq3qClpyXl0C/view?usp=sharing
Hi there,
I've been struggling for multiple days now trying to enable Multidex in order to build my project with Appodeal (which breaks the 64k methods limit) with Unity 2019.3 (betas 7 to 10). I've been through many issues, that I'm going to try to quickly describe here, as I'm sure it could spare some users some tears!
What I've done
1) I've created a cutsom mainTemplate.gradle file, in which I've added 'multiDexEnabled true' in the default config, and 'com.android.support:multidex:1.0.3…
For anyone looking for solution.
You have to move your
implementation ‘androidx.multidex:multidex:2.0.1’
and
multiDexEnabled true
from mainTemplate.gradle to launcherTemplate.gradle and it should work.
You should activate these files first here in the Project Setting->Player->Publishing Settings
I solved it in two steps for Unity 2019.3.11f1:
Go to Edit->Project Settings->Player->Publishing settings->Tick Custom Properties Gradle Template
Go to the newly generated gradleTemplate.properties and add these lines to the top:
android.useAndroidX=true
android.enableJetifier=true
10 Likes