Gradle Exception after upgrade to 1.9 SDK

Hey all,

I upgraded my project to SDK version 1.9.1 At first I had an error with LitJSON, but removing the entire folder fixed that. Now it wont build because of a Gradle issue.

Anyone has a clue what the problem can be? I am using Unity 22.1.4f1, and everything was working as expected. But since the update it just broke.’

Many thanks for anyone who can help

The error is:


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class ai.nreal.sdk.PermissionFragment found in modules nrunityandroidpermission-runtime.jar (:nrunityandroidpermission:) and nrunityandroidpermission.jar (nrunityandroidpermission.jar)
  Duplicate class ai.nreal.sdk.UnityAndroidPermissions found in modules nrunityandroidpermission-runtime.jar (:nrunityandroidpermission:) and nrunityandroidpermission.jar (nrunityandroidpermission.jar)
  Duplicate class ai.nreal.sdk.UnityAndroidPermissions$IPermissionRequestResult found in modules nrunityandroidpermission-runtime.jar (:nrunityandroidpermission:) and nrunityandroidpermission.jar (nrunityandroidpermission.jar)
  Duplicate class ai.nreal.unityandroidpermissions.BuildConfig found in modules nrunityandroidpermission-runtime.jar (:nrunityandroidpermission:) and nrunityandroidpermission.jar (nrunityandroidpermission.jar)
  
  Go to the documentation to learn how to Fix dependency resolution errors.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

1.9 had minor issues and they were fixed in 1.9.1

Sorry for the mistype, I am on 1.9.1, changed it in the original post

Try deleting the NRSDK folder and import again the package

Please let me know if you re-import the package and get same error tip.

That did the trick, thanks.

So basically, always remove the entire old NRSDK folder before upgrading to a new version.