Troubleshooting common issues with EDM
Solve common issues when working with the External Dependency Manager (EDM) package.
Enable verbose logging
When you need more resolver or build information, enable verbose logging and check the log after a build attempt. To enable verbose logging on Android and iOS:
- For Android, enable Verbose Logging in Assets > External Dependency Manager > Android Resolver > Settings.
- For iOS, enable Verbose Logging in Assets > External Dependency Manager > iOS Resolver > Settings.
Disable auto resolution on Android
When Auto Resolution is enabled, the Android resolver can trigger when assets are changed or when the App Domain reloads, for example when selecting the Play button in the Unity Editor. Dependency resolution can be slow when the Unity project is large, or when the resolver needs to download and patch many Android libraries.
To disable auto resolution and speed up iteration:
- Select Assets > External Dependency Manager > Android Resolver > Resolve or Assets > External Dependency Manager > Android Resolver > Force Resolve for manual resolution.
- Disable Enable Auto-Resolution in Assets > External Dependency Manager > Android Resolver > Settings to prevent resolution from running when assets change or when the App Domain reloads.
- Disable Enable Resolution on Build in the Settings menu to speed up build time.
Troubleshoot issues with EDM on Android
Fix Resolution Failed errors
If resolution fails, follow these steps. After each step, confirm that resolution succeeded before you continue.
Use Force Resolve to fix resolution errors
To resolve dependencies:
- Select Assets > External Dependency Manager > Android Resolver > Resolve.
- If this fails, select Force Resolve. Force Resolve is slower but more dependable because it clears old intermediate data.
Fix JDK, SDK, NDK, and Gradle issues
If you receive error logs about Unity being unable to locate the JDK, Android SDK Tools, NDK, or Gradle files, use the following steps to force Unity to recognize them:
- Navigate to Unity > Preferences > External Tools.
- Toggle the JDK, Android SDK, Android NDK and Gradle checkboxes to their opposite value.
- Toggle them back.
- Run Force Resolve or build again.
Enable Custom Main Gradle template
By default, EDM uses a custom Gradle script to download Android libraries to the Assets/Plugins/Android/ folder. This might cause the following issues:
- Duplicate class errors during build time, when Unity adds common Android libraries (such as
play-coreorgame-activity) with specific default versions. - Dependency conflicts, when multiple Unity plug-ins depend on the same Android libraries with a wide range of version requirements. The Gradle project that Unity generates resolves these conflicts more reliably than the custom script in EDM.
- Slow build times, when the resolver downloads large numbers of Android libraries.
If you use the legacy Android resolver method on Unity 2022.3 or later, you must enable Custom Gradle Properties Template in the Android Player settings to enable AndroidX and Jetifier. Refer to Enable Jetifier for more information.
Enable Jetifier
Android 9 introduced a new set of support libraries (AndroidX) which use the same class name but under a different package name. If your project has dependencies , including transitive dependencies, on both AndroidX and the older Android Support Libraries, duplicated class errors in com.google.android.support.* and com.google.androidx.* will occur during build time. Jetifier is a tool to resolve such cases. It's recommended to enable Jetifier if your target Android version is 9+, or API level 28+.
To use Jetifier, enable Use Jetifier from the Android Resolver > Settings menu. The Android Resolver uses Jetifier to patch every Android library in the Assets/Plugins/Android folder. To use AndroidX and Jetifier, you must also enable the Custom Gradle Properties Template from the Android Player settings, even if you don't use the Custom Main Gradle Template option.
Troubleshoot issues with EDM on iOS
If resolution fails for iOS, use the following steps. After each step, confirm that resolution succeeded before you continue.
Verify CocoaPods is installed correctly
- Ensure CocoaPods is installed correctly. For more information, refer to Getting Started (CocoaPods).
- Verify that
pod installandpod updaterun without errors in the folder where the Podfile is. This is usually the root folder of the Xcode project. For more information, refer to pod install vs. pod update (CocoaPods).
CocoaPods text encoding
When building from macOS, you might encounter issues related to text encoding. For example WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. To resolce this issue, try the following steps:
- From the terminal, run
pod installdirectly, and open the resultingxcworkspacefile. - Downgrade the version of CocoaPods to 1.10.2. The issue exists only in version 1.11 and newer.
- In your
~/.bash_profileor equivalent, addexport LANG=en_US.UTF-8.
Open Xcode Workspace files instead of Xcode Project files
Build iOS builds from Xcode Workspaces generated by CocoaPods, rather than using Xcode projects.
- Unity by default only generates
.xcodeprojfiles. If the EDM package is in the project, it first generates Podfiles from all iOS dependencies specified in files namedDependencies.xmlwith a prefix, for exampleAppDependencies.xml, then runs CocoaPods, which generates an.xcworkspacefile. - In this case, open the generated project by double-clicking on
.xcworkspaceinstead of.xcodeprojbecause the.xcworkspacefile contains references to pods. - If you build in an environment where you can't open Xcode workspaces, such as Unity Cloud Build, open iOS Resolver settings and set CocoaPods Integration to Xcode project.
Fix runtime Swift issues
If you run into an issue when trying to run the game and the error logs mention Swift, try the following:
- Enable Enable Swift Framework Support Workaround in Assets > External Dependency Manager > iOS Resolver > Settings.
- Read the description in the settings menu and ensure the changes are applied to the generated Xcode project.