Minify Release option breaks AR

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

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:

  -keepclassmembers public class com.google.ar.core.Session {
  static <methods>;
  }
  -keepclassmembers class com.google.ar.core.** { *; }
  -keep class com.google.ar.** { *; }
  -keep class com.google.vr.** { *; }
  -keep class com.unity3d.unitygar.** { *; }
  -keep class com.unity3d.plugin.** { *; }
  -keep class com.google.atap.tangoservice.** { *; }
  -keep class com.google.tango.** { *; }
  -keepclassmembers class com.google.ar.core.Pose {
  private <fields>;  
  }

Hope this helps!

4 Likes

you saved me, thanks a lot!

1 Like

You’re welcome!

I’ve made a note for us to look into this, but it would help if someone could file a bug with a repro case so our QA team can be aware of this issue? Unity QA: Building quality with passion