Search Unity

Question Minify Release option breaks AR

Discussion in 'AR' started by Project-NSX, Sep 7, 2022.

  1. Project-NSX

    Project-NSX

    Joined:
    Apr 11, 2019
    Posts:
    25
    The option "Release" in Player Settings > Publishing Settings > Minify appears to break AR for both APK and A AB builds.

    This option is required as it creates a ReTrace Mapping file that is required to publish a build on the Google Play Store.

    Is there a fix for this or is there another way to create the required ReTrace Mapping file?

    The issue is present using Unity 2021.3.8f1

    Thanks
     
  2. Project-NSX

    Project-NSX

    Joined:
    Apr 11, 2019
    Posts:
    25
    To anyone who finds this having the same issue.
    This issue is solved by going to Player Settings > Other and ticking "Custom Proguard File", then open the file it points to in Assets > Plugins > Android > proguard.txt and add the following text to it:
    Code (CSharp):
    1.   -keepclassmembers public class com.google.ar.core.Session {
    2.   static <methods>;
    3.   }
    4.   -keepclassmembers class com.google.ar.core.** { *; }
    5.   -keep class com.google.ar.** { *; }
    6.   -keep class com.google.vr.** { *; }
    7.   -keep class com.unity3d.unitygar.** { *; }
    8.   -keep class com.unity3d.plugin.** { *; }
    9.   -keep class com.google.atap.tangoservice.** { *; }
    10.   -keep class com.google.tango.** { *; }
    11.   -keepclassmembers class com.google.ar.core.Pose {
    12.   private <fields>;  
    13.   }
    Hope this helps!
     
  3. sjwewuuu

    sjwewuuu

    Joined:
    Nov 27, 2019
    Posts:
    3
    you saved me, thanks a lot!
     
    Project-NSX likes this.
  4. Project-NSX

    Project-NSX

    Joined:
    Apr 11, 2019
    Posts:
    25
    You're welcome!
     
  5. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062