arduino/Arduino · warning · Exception

Platform is already installed!

Error message

Platform is already installed!

What it means

ContributionInstaller.install() first checks contributedPlatform.isInstalled() and refuses to proceed if that platform is already installed. The guard prevents duplicate installations and corrupted state; it throws a plain Exception with this message.

Source

Thrown at arduino-core/src/cc/arduino/contributions/packages/ContributionInstaller.java:76

import java.util.*;
import java.util.stream.Collectors;

import static processing.app.I18n.format;
import static processing.app.I18n.tr;

public class ContributionInstaller {
  private final Platform platform;
  private final SignatureVerifier signatureVerifier;

  public ContributionInstaller(Platform platform, SignatureVerifier signatureVerifier) {
    this.platform = platform;
    this.signatureVerifier = signatureVerifier;
  }

  public synchronized List<String> install(ContributedPlatform contributedPlatform, ProgressListener progressListener) throws Exception {
    List<String> errors = new LinkedList<>();
    if (contributedPlatform.isInstalled()) {
      throw new Exception("Platform is already installed!");
    }

    // Do not download already installed tools
    List<ContributedTool> tools = new ArrayList<>();
    for (ContributedTool tool : contributedPlatform.getResolvedTools()) {
      DownloadableContribution downloadable = tool.getDownloadableContribution(platform);
      if (downloadable == null) {
        throw new Exception(format(tr("Tool {0} is not available for your operating system."), tool.getName()));
      }
      // Download the tool if it's not installed or it's a built-in tool
      if (!tool.isInstalled() || tool.isBuiltIn()) {
        tools.add(tool);
      }
    }

    DownloadableContributionsDownloader downloader = new DownloadableContributionsDownloader(BaseNoGui.indexer.getStagingFolder());

    // Calculate progress increases

View on GitHub (pinned to a0df6e0e83)

Solutions

  1. Check contributedPlatform.isInstalled() before calling install(), or catch the Exception and treat it as a no-op.
  2. To replace/upgrade, first call remove/reverse installation of the existing platform, then install the new version.
  3. Refresh the package index and installed-state so isInstalled() reflects reality (e.g. after manual deletion of hardware folders).
  4. Compare exact versions in your own code to distinguish 'same version installed' from 'newer version available'.

Example fix

// before
installer.install(platform, listener);
// after
if (!platform.isInstalled()) {
  installer.install(platform, listener);
}
Defensive patterns

Strategy: validation

Validate before calling

if (platform.isInstalled()) { return Collections.emptyList(); } // already satisfied
installer.install(platform, listener);

Try / catch

try { installer.install(platform, listener); } catch (Exception e) { if ("Platform is already installed!".equals(e.getMessage())) { /* treat as success */ } else { throw e; } }

Prevention

When it happens

Trigger: Calling install(contributedPlatform, progressListener) for a platform whose isInstalled() returns true — typically re-invoking install for a platform already present in the installed packages state.

Common situations: Automated scripts re-running an install step idempotently without checking state first; stale index after an install in the same session; version pinning code comparing only by name so an 'upgrade' attempt is seen as already-installed.

Understand the failure class

Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.

Related errors


AI-assisted analysis of arduino/Arduino@a0df6e0e83 (2026-09-06). Data as JSON: /api/errors/51fe0471ca490acc. Report an issue: GitHub.