Unity SDK Troubleshooting

This appendix provides solutions to common errors encountered during the integration process of the Unity SDK.

UnityException - Old aaptOptions noCompress Property Definition

Description:

When integrating the Unity SDK, you may encounter the following error in the mainTemplate.gradle file:

"Error mainTemplate.gradle file is using the old aaptOptions noCompress property definition which does not include types defined by unityStreamingAssets constant."

Solution:

To resolve this issue, update the mainTemplate.gradle file with the following code:

aaptOptions {
  noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
  ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}

This update ensures that the noCompress property includes types defined by the unityStreamingAssets constant.

Unity 2021 Build Issues

If you encounter issues during compilation on Unity 2021, please try the following steps:

  1. Make sure you implemented the correct api keys from the dashboard
  2. Add/Remove changes to mainTemplate file (try keeping this line: implementation fileTree(dir: 'libs', include: ['*.jar']) line)
    See the mainTemplate step in our integration guide. Try to remove/add dependencies
  3. Remove "classes.jar" inside the libs folder inside the .aar file
  4. Set API level to 24 or higher.