Troubleshooting

Unity

Error: Assembly has reference to non-existent assembly

Problem

Unity shows the following error or similar one:

Assembly has reference to non-existent assembly 'GUID:eaec8203738b0462a8e9a7a1e366da88' (Assets/SmartySDK/Alpha/Scripts/Smarty.Alpha.Main.asmdef)

Cause

It is probably a bug in older Unity versions (< 2019).

Solution

Remove all .asmdef files from project.

  1. Search for 't:asmdef' in Project pane

  2. Select all .asmdef files

  3. Delete them.

Error: "An assembly with the same name `Google.IOSResolver' has already been imported."

Problem

Unity shows the following error:

error CS1704: An assembly with the same name `Google.IOSResolver' has already been imported. Consider removing one of the references or sign the assembly
Assets/PlayServicesResolver/Editor/Google.IOSResolver_v1.2.71.0.dll (Location of the symbol related to previous error)
Assets/PlayServicesResolver/Editor/Google.IOSResolver_v1.2.62.0.dll (Location of the symbol related to previous error)

Cause

It happens after importing at least two packages that uses different versions of Unity Jar Resolver.

Solution

Restart Unity and allow Unity Jar Resolver Version Handler to delete obsolete files.

It will remove duplicated libraries.

Android Studio Multiple SDKs monit

Android

Unity fails to build Android application

Problem

Unity Android Internal building results in bugs.

Cause

Older Unity version doesn’t support the newest versions of Android SDK.

More about this can be found here and here.

Solution

Prepare separate Android SDK for Unity internal usage.

  1. Check your Android SDK tools version.

    • Open your Android Studio and select menu item Tools  Android  SDK Manager.

    • Switch to SDK tools tab and find Android SDK Tools entry.

  2. If you have Android SDK tools < 25.3.1 then:

    • Copy ~/Library/Android/sdk directory to ~/Library/Android/sdk-unity.

    • Set Unity Android SDK directory to ~/Library/Android/sdk-unity in Unity  Preferences under External Tools  Android  SDK.

  3. If you have Android SDK tools >= 25.3.1 then:

    • Copy ~/Library/Android/sdk to ~/Library/Android/sdk-unity.

    • Replace tools subfolder in ~/Library/Android/sdk-unity as described here.

    • Set Unity Android SDK directory to ~/Library/Android/sdk-unity in Unity  Preferences under External Tools  Android  SDK.

AndroidStudio and multiple SDKs

When you open exported project in AndroidStudio it will ask you which too choose Android SDK.

Android Studio Multiple SDKs monit

Select Use Android Studio’s SDK.

Selecting Use Project’s SDK will change AndroidStudio global Android SDK setting, which will influance your other projects.

Error: "TaskInputUnionFileCollection cannot be cast to DefaultConfigurableFileCollection"

Problem

The following error:

Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection

shows up after synchronizing gradle.

This can happen after launching AndroidStudio.

Solution

Update Android Plugin for gradle to the newest version.

You can configure it in Android project main build.gradle file. For example:

buildscript {
	dependencies {
		classpath 'com.android.tools.build:gradle:2.3.1'
	}
}