diff --git a/README.md b/README.md index 7abdddf45..593b989fc 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,52 @@ Thanks to [@PiotrxKolasinski](https://github.com/PiotrxKolasinski) for writing d ## Troubleshooting +**Location:** Unity + +**Error:** + +``` +Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll) + +PrecompiledAssemblyException: Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. +``` + +**Solution:** +Locate the listed dll file, in this case: +`Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll` + +- Option 1: +Delete the dll file or rename the file extension (e.g. `.dll.txt`) to stop it from being imported. +- Option 2: +Uninstall the package that conflicts in the Unity package manager (usually Version control, or Collab). +The exact package can be found by looking for newtonsoft in `package-lock.json` + +--- + + +**Location:** Unity + +**Error:** + +``` +The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) +The type or namespace name 'JObject' could not be found (are you missing a using directive or an assembly reference?) +The type or namespace name 'JToken' could not be found (are you missing a using directive or an assembly reference?) +The type or namespace name 'JToken' could not be found (are you missing a using directive or an assembly reference?) +``` + +**Solution:** + +Include the Newtonsoft JsonDotNet library. +It is likely already included in your project with a wrong file extension: +`Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.txt` +Rename the `.dll.txt` extension to `.dll` in your file explorer and open Unity again. + +Alternatively you can manually add [the library](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.1/manual/index.html) from the Unity package manager. + +--- + + **Location:** Unity **Error:** diff --git a/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.txt b/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll similarity index 100% rename from example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.txt rename to example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll diff --git a/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta b/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta new file mode 100644 index 000000000..5efd7ba47 --- /dev/null +++ b/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: a2594cf7d48856c44a6a855a987483d7 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.txt.meta b/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.txt.meta deleted file mode 100644 index 001df1ae2..000000000 --- a/example/unity/DemoApp/Assets/FlutterUnityIntegration/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a24da196ba50946e18c40d06973cde72 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example/unity/DemoApp/Packages/manifest.json b/example/unity/DemoApp/Packages/manifest.json index 3b181e8c5..b6876851a 100644 --- a/example/unity/DemoApp/Packages/manifest.json +++ b/example/unity/DemoApp/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.unity.collab-proxy": "1.17.1", + "com.unity.collab-proxy": "2.0.3", "com.unity.ext.nunit": "1.0.6", "com.unity.ide.rider": "3.0.15", "com.unity.ide.visualstudio": "2.0.16", diff --git a/example/unity/DemoApp/Packages/packages-lock.json b/example/unity/DemoApp/Packages/packages-lock.json index 17d3b4557..13e918d19 100644 --- a/example/unity/DemoApp/Packages/packages-lock.json +++ b/example/unity/DemoApp/Packages/packages-lock.json @@ -1,12 +1,10 @@ { "dependencies": { "com.unity.collab-proxy": { - "version": "1.17.1", + "version": "2.0.3", "depth": 0, "source": "registry", - "dependencies": { - "com.unity.services.core": "1.0.1" - }, + "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.editorcoroutines": { @@ -48,26 +46,8 @@ "dependencies": {}, "url": "https://packages.unity.com" }, - "com.unity.nuget.newtonsoft-json": { - "version": "3.0.2", - "depth": 2, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, - "com.unity.services.core": { - "version": "1.4.2", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.modules.androidjni": "1.0.0" - }, - "url": "https://packages.unity.com" - }, "com.unity.subsystemregistration": { - "version": "1.1.1", + "version": "1.1.0", "depth": 1, "source": "registry", "dependencies": { @@ -151,7 +131,7 @@ "url": "https://packages.unity.com" }, "com.unity.xr.arsubsystems": { - "version": "4.2.3", + "version": "4.2.7", "depth": 1, "source": "registry", "dependencies": { @@ -161,7 +141,7 @@ "url": "https://packages.unity.com" }, "com.unity.xr.legacyinputhelpers": { - "version": "2.1.9", + "version": "2.1.10", "depth": 1, "source": "registry", "dependencies": { diff --git a/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt b/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt index a68fd91bb..f8251a7af 100644 --- a/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt +++ b/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2022.1.13f1 -m_EditorVersionWithRevision: 2022.1.13f1 (22856944e6d2) +m_EditorVersion: 2021.3.22f1 +m_EditorVersionWithRevision: 2021.3.22f1 (b6c551784ba3)