Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Minify removes the code related to Mobile Notification Package

Discussion in 'Android' started by steve118, Feb 9, 2021.

  1. steve118

    steve118

    Joined:
    Jan 23, 2021
    Posts:
    58
    When I select the Grandle option under the Minify setting in the Player Settings, it removes the code related to Mobile Notification Package. This is the logcat related to the error:



    If set Minify to None, everything starts working.
     
  2. VaidasM

    VaidasM

    Unity Technologies

    Joined:
    Jun 27, 2017
    Posts:
    41
    Hey Steve,

    Could you submit a bug report via the editor, including as much information as possible about the issue at hand (steps to reproduce the issue, project that's reproducing the issue)?
    Please post the ticket number here. It does seem like an issue that needs attention
     
  3. afmj

    afmj

    Joined:
    Sep 29, 2017
    Posts:
    4
    I am also getting this issue, in my case im just doing the same thing as the Mobile notification example in the documentation, my project builds for Android and i'm Minifying with Proguard.
     
  4. VaidasM

    VaidasM

    Unity Technologies

    Joined:
    Jun 27, 2017
    Posts:
    41
    @afmj could you provide me your used notification package version? I'll try reproducing the issue
     
  5. msnz

    msnz

    Joined:
    Nov 4, 2020
    Posts:
    31
    Has there been a solution for this? I'm experiencing the same issue.
     
  6. tduriga

    tduriga

    Joined:
    Dec 9, 2015
    Posts:
    52
    Try to add this to the proguard-user.txt file:
    Code (csharp):
    1. -keep class com.unity.androidnotifications.** { *;}
    2. -keepclassmembers class com.unity.androidnotifications.** { *;}
    3. -keepnames class com.unity.androidnotifications.** { *;}
    4. -keepclassmembernames class com.unity.androidnotifications.** { *;}
     
    msnz likes this.