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

Unity 2019.3: Android build error: D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub #269

Closed bilck closed 4 years ago

bilck commented 4 years ago

We are having the following error when building for Android on Unity 2019.3.0f6: D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub

The build works perfectly when we comment out OneSignal's "com.android.support" library dependency in OneSignalDependencies.xml, but (of course) OneSignal doesn't work.

Do you have any idea on how to fix this issue?

We use the following relevant plugins:

jkasten2 commented 4 years ago

@bilck This is due to a mixture of Android Support Library and AndroidX in your project. Google's Jetifier resolves this problem and we have a guide on enable this note below. https://documentation.onesignal.com/docs/troubleshooting-unity#section-android-x-compatibility

bilck commented 4 years ago

@jkasten2 , That link didn't fix my issue.

I recreated our project's mainTemplate.gradle and created a settingsTemplate.gradle, according to the instructions. Both files are attached to this issue.

GradleFiles.zip

The same error is being raised: D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy