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

Error building Project OneSignal + AdMob (latest version all packages) #274

Closed mike993 closed 4 years ago

mike993 commented 4 years ago

Hi, i have the same problem after update (android build).

How did you solve this problem?

I have all the latest Packages and unity version: **- Unity 2019.3.1 -PlayServicesResolver 1.2.135

  1. I already follow the instruction on -> https://documentation.onesignal.com/docs/troubleshooting-unity#section-androidx-compatibility

  2. i tried to delete admob or onesignal and all worked well but togheter didn't work.

I tried all fix found on old issue on this git repo... but nothing worked.

Look my attachment for grandle files.

Someone can help me? Thanks

image

mainTemplate.gradle.txt settingsTemplate.gradle.txt

Originally posted by @mike993 in https://github.com/OneSignal/OneSignal-Unity-SDK/issues/223#issuecomment-587074236

Soxs commented 4 years ago

Exact same issue with me. Onesignal + Google Admob. It's incredibly stressful as I've been trying to get push notification in my app for months. I was delighted to see that this issue was meant to be fixed, but I'm still running in circles trying to setup OneSignal on an android Unity project.

RealMSHB commented 4 years ago

Same here. I also tested all the solutions that was mentioned in other threads.

mike993 commented 4 years ago

At least i'm not the only one with this problem...

jkasten2 commented 4 years ago

Updated (2021/03/21):

  1. If you have follow the previous OneSignal instructions for AndroidX (noted below) first remove the OneSignal specific entries from these files:
    • Assets/Plugins/Android/settingsTemplate.gradle
    • Assets/Plugins/Android/mainTemplate.gradle
  2. Upgrade to OneSignal-Unity-SDK 2.13.4 or newer
  3. Follow the latest OneSignal AndroidX Compatibility guide

Feb 23, 2020 (out of date):

Thanks for reporting the issue. We have updated our AndroidX Compatibility instructions to account for incompatibility when using Unity 2019.3, AdMob 4.12, and OneSignal.

The important changes are if Using Unity 2019.3 are:

  1. Uncheck "Custom Gradle Template" under File > Build Settings...
    • Or delete Assets/Plugins/Android/settingsTemplate.gradle to achieve the same results if you don't need it.
    • If you do need this custom gradle file for other reasons remove apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin' from this file.
  2. Replace Assets/Plugins/Android/settingsTemplate.gradle with the new contents from step 5A
roointan commented 3 years ago
  • settingsTemplate

Link content seems drastically changed and invalid now.

jkasten2 commented 3 years ago

@roointan I updated my https://github.com/OneSignal/OneSignal-Unity-SDK/issues/274#issuecomment-590146598 with how to remove the old settings and update to the more compatible setup.