◉CLAUDE LABJP
●2.1.310 — Monitor tool now works on Bedrock, Vertex and Foundry, and gateway failures are fixed (10/23)●2.1.307 — Fixes MCP failing to reconnect after sleep or a keychain lock (10/21). 2.1.306 also fixed the false claude -p login message●SONNET 4.5 — Retires on the Claude API on 11/30, 36 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●API — In API version 2026-10-21, passing temperature, top_p or top_k returns a 400 error●NEW — I Put a Ten-Line Promise File at the To…●2.1.310 — Monitor tool now works on Bedrock, Vertex and Foundry, and gateway failures are fixed (10/23)●2.1.307 — Fixes MCP failing to reconnect after sleep or a keychain lock (10/21). 2.1.306 also fixed the false claude -p login message●SONNET 4.5 — Retires on the Claude API on 11/30, 36 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●API — In API version 2026-10-21, passing temperature, top_p or top_k returns a 400 error●NEW — I Put a Ten-Line Promise File at the To…
Articles/Cowork
◈ Cowork/2026-10-25Intermediate

The Build Stopped on 'Duplicate Resources' — 80+ Conflicted Copies Came From Build Output in a Synced Folder

An Android project inside Dropbox stopped building with a duplicate-resource error. This note covers a scan script that counts the conflicted copies, a pre-build guard that cleans only generated files, and how to exclude folders from sync.

Dropbox4Cowork55BuildSynced Foldersbash7Python24

✦ Premium Article

I was updating the Android version of one of my wallpaper apps and ran the build. It stopped with a "duplicate resources" error I had never seen before.

I had not touched the source. Yet the build output folder was full of files with doubled names. When I counted, there were more than 80 conflicted copies.

The cause was not code. The sync client treated files that are recreated on every build as edits from another device, and duplicated them.

Conflicted copies come from files that get rebuilt

When Dropbox decides the same file changed in two places, it keeps a copy named like (Name's conflicted copy 2026-10-21).

For a document a person edits, that is a kindness. Build output is different. A crash-reporting plugin regenerates a certain file on every build, and when that rewrite overlaps with a sync write-back, a second version appears in the same place and the copies pile up.

The build tool picks up everything in the output folder, copies included. Two resources with the same name, and it stops on "duplicate".

The table below is the split the two scripts that follow are built on.

LocationWho writes itIf a conflicted copy appears
Source (src, etc.)YouDo not delete; inspect and decide
build / .gradleThe build toolSafe to delete (rebuilt next time)
Pods / xcuserdataPackage manager / XcodeSafe to delete (regenerable)

Count first: know what is where

Before cleaning anything, count. The point is to learn whether a conflicted copy has landed somewhere you must not delete from.

#!/usr/bin/env python3
"""Count Dropbox conflicted copies. Copies under generated folders are tallied separately."""
import os, re, sys, collections
 
CONFLICT = re.compile(
    r"\((?:.+?)['’]s conflicted copy \d{4}-\d{2}-\d{2}(?: \d+)?\)|\(.*競合コピー.*\)"
)
GENERATED = {"build", ".gradle", "Pods", ".swiftpm", "xcuserdata", "node_modules", ".next"}
 
def scan(root):
    total, scanned = 0, 0
    by_dir = collections.Counter()
    for dirpath, dirnames, filenames in os.walk(root):
        dirnames[:] = [d for d in dirnames if d != ".git"]   # never read .git
        for name in filenames:
            scanned += 1
            if CONFLICT.search(name):
                total += 1
                parts = set(os.path.relpath(dirpath, root).split(os.sep))
                hit = sorted(parts & GENERATED)
                by_dir[hit[0] if hit else "(source)"] += 1
    return scanned, total, by_dir
 
if __name__ == "__main__":
    scanned, total, by_dir = scan(sys.argv[1])
    print(f"scanned={scanned} conflicts={total}")
    for k, v in by_dir.most_common():
        print(f"  {k}: {v}")
    sys.exit(1 if total else 0)

This answers not "are there any" but "how many, and in which kind of place" in one pass. The exit code lets a pre-build guard or a routine check use it later.

Why it is written this way: the pattern covers both English and Japanese names, because Dropbox localizes the label.

I ran it on a small folder shaped like a build output:

scanned=5 conflicts=4
  build: 3
  (source): 1

I also ran it across my whole working folder (a little under 98,000 files). It found 0 conflicted copies and took about 17 seconds. On a large tree, plan on tens of seconds, and run it once in the morning or on the project folder only, not on every build.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You can count conflicted copies in a synced project with a single scan command and see exactly which kind of folder they are accumulating in
✦You can add a pre-build guard that deletes conflicted copies only in generated folders and stops the build when one appears in source, before the build fails on duplicates
✦You can decide which folders to exclude from sync by one test: does the build recreate it every time
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ Cowork2026-10-22
Half My Scheduled-Task Logs Were Unreadable, So I Added One Mark Line Instead of Widening the Regex
Only about half of 1,076 daily log entries yielded a result. Widening the regex recovered 35 and raised false alarms, so I wrote a fixed one-line mark per run and a morning check script.
◈ Cowork2026-10-15
Visible in the Listing, Zero Hits by Name: Counting Japanese Filenames With Split Dakuten
In a folder I gave Cowork, Japanese filenames were missing from name searches. Counting about 19,000 entries turned up 17 names with decomposed dakuten. Here is how I counted and fixed it.
◈ Cowork2026-10-21
Why I Stopped Borrowing a Stale Repo and Started Cloning Fresh After a Scheduled Task Couldn't Write to Shared /tmp
A scheduled task stopped because it could not create its clone directory under /tmp. Here is how I traced it, the borrowable clone that was about 9.6 hours behind, the cost of cloning fresh every run, and a script that picks a working directory.