Unity-Technologies/UnityCsReference · error · ApplicationException
Couldn't find module for target: {device.module}
Error message
Couldn't find module for target: {device.module} What it means
Thrown by ModuleManager.GetDevice when DevDeviceList.FindDevice succeeds for a deviceId but FindPlatformSupportModule(device.module) returns null — meaning the device exists in the list but its declared module string does not map to a registered IPlatformSupportModule.
Source
Thrown at Editor/Mono/Modules/ModuleManager.cs:282
internal static IPlatformSupportModule FindPlatformSupportModule(GUID platformGuid)
{
if (platformSupportModulesByGuid.TryGetValue(platformGuid, out var module))
return module;
return null;
}
internal static IDevice GetDevice(string deviceId)
{
DevDevice device;
if (DevDeviceList.FindDevice(deviceId, out device))
{
IPlatformSupportModule module = FindPlatformSupportModule(device.module);
if (module != null)
return module.CreateDevice(deviceId);
else
throw new ApplicationException("Couldn't find module for target: " + device.module);
}
throw new ApplicationException("Couldn't create device API for device: " + deviceId);
}
internal static IBuildTarget GetIBuildTarget(BuildTarget target)
{
var targetModuleName = BuildTargetDiscovery.GetModuleNameForBuildTarget(target);
if (platformSupportModules.TryGetValue(targetModuleName, out var module))
{
return module.PlatformBuildTarget;
}
return null;
}
internal static IBuildTarget GetIBuildTarget(GUID platformGuid)
{View on GitHub (pinned to 225b0fbdb5)
Solutions
- Install the platform Build Support module for the device's platform via Unity Hub > Installs > Add Modules.
- Restart the editor after installing modules so platformSupportModules is repopulated.
- Verify the device entry in DevDeviceList has the correct .module string matching an installed module name.
- Remove stale device entries that reference uninstalled platforms.
Example fix
// before: module not registered, GetDevice throws
IDevice d = ModuleManager.GetDevice(deviceId);
// after: guard before calling
var dev = DevDeviceList.GetDevices().FirstOrDefault(x => x.id == deviceId);
if (dev != null && ModuleManager.FindPlatformSupportModule(dev.module) != null)
IDevice d = ModuleManager.GetDevice(deviceId); Defensive patterns
Strategy: validation
Validate before calling
DevDevice device;
if (DevDeviceList.FindDevice(deviceId, out device) &&
ModuleManager.FindPlatformSupportModule(device.module) != null)
var d = ModuleManager.GetDevice(deviceId); Try / catch
try { var d = ModuleManager.GetDevice(id); }
catch (ApplicationException ex) when (ex.Message.Contains("find module"))
{ /* prompt user to install the module */ } Prevention
- Install platform Build Support modules via Unity Hub.
- Re-scan devices after installing modules.
- Guard with FindPlatformSupportModule before GetDevice.
When it happens
Trigger: Calling ModuleManager.GetDevice(deviceId) for a device whose .module field names a platform support module that is not currently loaded/registered in platformSupportModules.
Common situations: Target platform module (e.g., Android, iOS, UWP build support) is not installed in the Unity editor while a connected device of that type is present. Corrupted or manually-edited DevDeviceList entries referencing uninstalled modules.
Related errors
- Couldn't create device API for device: {deviceId}
- The build target does not support build appending.
- Code coverage is unavailable for the selected build target.
- target must be valid
- Cannot add {moduleName} after UnityLinker has run because it
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/c391837ea9634104.
Report an issue: GitHub.