跪拜 Guibai
← Back to the summary

Stop Blindly Copying Flutter: The Four Cost Ledgers That Decide Cross-Platform Architecture in 2026

Foreword: The Project That Changed My Mind

Last year we took on a refactoring request for a health app. The shape was typical: an existing Android + iOS dual-native app, needing to add a WeChat mini-program entry, plus hardware capabilities like Bluetooth body-fat scales, medical insurance e-credentials, and prescription scanning.

In the first version of the plan, the loudest voice in the team was "Let's use Flutter — one codebase for three platforms, and we can halve the headcount."

I asked three questions, and that proposal never made it back to a meeting:

  1. The Bluetooth scale vendor only ships SDKs as .aar and .framework — no Flutter plugin, and they won't make one. What do you plan to do?
  2. The medical insurance e-credential requires a national cryptography algorithm library that only exists as Android .so and iOS .framework. What about the mini-program side?
  3. This app has been live for three and a half years, with 110,000 lines of Kotlin on Android and 90,000 lines of Swift on iOS. Are you planning to rewrite from scratch?

The third question turned the meeting into a two-hour marathon.

That day I learned something: the word "cross-platform" carries no information on its own. The real question is — where do you draw the boundary you want to cross? Drawing it at the UI level (Flutter / React Native / Compose Multiplatform) puts the cost on components and visuals; drawing it at the business-logic level (KMP / pure-TS logic layer) puts the cost on engineering configuration and talent; drawing it at "one codebase compiles to all runtimes simultaneously" (uni-app x / Taro) concentrates cost on package size and platform-difference code.

Different boundary positions mean the four ledgers are calculated completely differently.

Below I'll lay out the real options for 2026, then walk through each cost.


1. First, Lay Out the Options: These Are Two Pools, Not One

Much discussion confuses the issue from the start by treating "mini-programs" as one "platform" in the cross-platform framework. It isn't.

App Pool (Android + iOS)

Solution Language UI Form 2026 Status
Flutter Dart Self-drawn (Impeller) Flutter 3.47 (2026-08), Impeller is the default renderer on all platforms, Material/Cupertino widgets split into separate packages, minimum requirement raised to iOS 15
React Native JS/TS Platform native views (Fabric) Old Bridge fully removed since 0.82, Hermes V1 default engine since 0.84, 0.87 (2026-08) current stable; Expo SDK 55 shipped with RN 0.83, with React 19.2, Router v7, OTA incremental download size down about 75%, brownfield embedding
Kotlin Multiplatform Kotlin Optional (native / Compose Multiplatform) Compose Multiplatform 1.11.0 (2026-05) stable on iOS, non-Android targets use Skiko/Skia rendering; K2 compiler default, Swift Export enabled by default (Kotlin directly to Swift, no more ObjC intermediate layer)
Native dual Kotlin + Swift Native Baseline, not an alternative

Mini-program Pool (WeChat / Alipay / Douyin / H5 / Quick App)

Solution Base Key Points
Native mini-program WXML/WXSS/JS Highest performance ceiling, fullest platform features, but multiple platforms require multiple implementations
uni-app / uni-app x Vue + (JS/UTS) Thickest ecosystem (plugin market 8000+), uni-app x uses UTS to compile directly to Kotlin/Swift/ArkTS, "vapor mode" skips WebView layer
Taro 4.x React/Vue Compile-time + runtime hybrid architecture, npm weekly downloads about 180k, 45.2k GitHub stars, WeChat/Alipay/Douyin/H5 + RN + HarmonyOS, HarmonyOS via source-level conversion
Container solutions (FinClip / mPaaS etc.) Reuse WeChat mini-program DSL WeChat mini-program code runs in your own app with zero modifications, SDK light (FinClip about 3MB), common in regulated financial/government scenarios
Kuikly (Tencent open-source) KMP Goal is "one code, five platforms": Android/iOS/HarmonyOS/H5/mini-program, AOT compiled native binaries

Key understanding: App pool and mini-program pool are two runtimes, two mental models. Flutter can't beat a mini-program engine, and a mini-program framework can't replace native View systems on the App side. So "one codebase, three platforms" often means you maintain two rendering logics, not one.

A realistic expectation for code reuse: in a three-platform project, sharing 30%–50% of code is normal, reaching 60% is already good, and exceeding 70% usually means you've compromised on some platform. Anyone who tells you 90% is possible almost certainly never shipped a real project.


2. Ledger #1: Custom Component Cost

The core question of this ledger: will the component that "looks right" work smoothly on all three platforms?

Flutter: Self-drawing Means "Consistency" Is Cheap, "Native-like" Is Expensive

Flutter draws every pixel itself. The upside is pixel-perfect design implementation, identical look on iOS and Android, great for brand-heavy pages (e-commerce promotions, market data, health dashboards), and the most animation freedom.

The cost is in the other direction: Flutter's iOS is an "imitation iOS", not "real iOS".

The cost of third-party UI libraries has a counterintuitive aspect: the burden isn't mainly on you, it's on the library author. A component library must maintain three implementations (Flutter, Android, iOS), tripling the author's effort. So the ecosystem is full of components that are "polished on Android, good-enough on iOS." On the business side you have almost zero cost, but you have to do your own acceptance testing; don't expect library authors to test iOS for you.

React Native: Uses Native Controls, "Consistency" Costs Money, "Native-like" Is Free

With Fabric, RN renders real platform Views, so on iOS you get iOS look-and-feel, on Android you get Android look-and-feel, and system-level interactions come for free (you don't write them).

The flip side: if you want visual consistency across both platforms, you have to smooth the differences yourself: SafeArea, safe-area adaptation, fonts (SF Pro can't be used directly; you need fallbacks), shadow parameters, spacing baselines — each platform has its own conventions.

In real projects, style files inevitably split:

/components/Button/
  Button.tsx
  Button.ios.tsx
  Button.android.tsx
  tokens.ts   // Design tokens live here, shared

tokens.ts is shared; the two platform files diverge. After divergence, every design change means editing three files. That's RN's custom component cost — not at initial development, but in long-term evolution.

Kotlin Multiplatform: Offers You "Shared Logic" and "Shared UI" as Separate Options

KMP's greatest flexibility is that it doesn't force an all-or-nothing choice.

Option A: Share only logic, write UI separately. Android uses Jetpack Compose, iOS uses SwiftUI. This is currently the most stable approach — both platforms get truly native experience; what's shared is the network layer, data models, business rules, state machines.

The cost: you maintain two UI codebases. UI consistency relies on design specs and token documentation, not code.

Option B: Share UI via Compose Multiplatform. The benefit is Jetpack Compose knowledge transfers directly, so an Android team has almost zero learning cost. The cost is that iOS goes through Skiko rendering, facing the same class of problems as Flutter — it's not UIKit/SwiftUI controls. Swipe-back, navigation transitions, system gestures must be simulated yourself or done via UIKit interop embedding native views. iOS text rendering and system fonts also differ from UIKit.

A side engineering fact: compiling KMP for iOS requires a macOS runner. Public reports mention a 150-person mobile team seeing CI costs double after full KMP adoption — because Linux runners can't build iOS targets, and if you don't have enough Mac mini machines you buy cloud Macs. JetBrains' klib cross-platform compilation could bypass this, but as of mid-2026 it's not stable. Budget for this cost from year one.

Mini-programs: Components Are "Another Set", Cross-platform Reuse Is Nearly Zero

Mini-program custom components have their own rules: style isolation (styleIsolation), triggerEvent cross-component communication, slot implementations inconsistent across platforms, cover-view / cover-image stacking limitations on native components (can't overlay video, map, canvas), and map / video unsupported on some platforms.

The worst part: getting one custom component working across WeChat, Alipay, and Douyin is essentially rewriting it three times. Property naming, event models, slot behavior, style units, slot passthrough — each platform has deviations. Taro and uni-app's conditional compilation can handle "it runs", but not "consistent detail experience across every platform".

Ledger #1 Summary

Visual Consistency Native Feel Long-term Maintenance Pressure
Flutter Highest Medium Medium (two widget systems to balance)
React Native Medium (needs token discipline) High High (style file divergence)
KMP (shared logic + native UI) Low (relies on specs) Highest Low (UI evolves independently)
KMP (CMP shared UI) High Medium Medium
Mini-program multi-platform Medium High within platform, low across High (conditional compilation bloat)

3. Ledger #2: Hardware Extension Cost

This ledger is decisive, and it's the page many cross-platform proposals skip at project kickoff.

Here are the most common hardware capabilities in real projects:

RN: Write Native Code Twice

TurboModule has improved a lot — JSI direct connection, no JSON serialization bottleneck, type safety via codegen. But for each new hardware capability you write two implementations:

And it's bound at compile time — changing one line of native code requires recompiling the entire app, no hot update.

Ecosystem quality is the biggest trap in this dimension. react-native-ble-plx is a good library; react-native-usb is typical "usable but you'll fix it yourself"; react-native-hardware-* versions often don't match RN major versions. Choosing RN for hardware means accepting a loosely-maintained community module market.

Flutter: Platform Channel Is Good Design, but Plugin Lag Is the Norm

Flutter's three paths — Platform Channel / Pigeon / Dart FFI — are well-thought-out:

Flutter's plugin market is currently the most complete (flutter_blue_plus, flutter_nfc_kit work), but when a new hardware device comes out, plugins always lag. And when the SDK you need is only .aar / .framework with no Flutter plugin — which is common because hardware vendors don't know Dart — you must write your own native plugin, which puts you back on the RN path, just with an extra channel codec layer.

KMP: Closest to "One Codebase for Hardware"

expect / actual for interface abstraction, cinterop for direct binding to platform C APIs (Android NDK/JNI, iOS C/ObjC). This gives the strongest abstraction capability at the hardware layer — writing Android's Binder and iOS's CoreBluetooth in the same Kotlin file is completely feasible.

With K2 compiler and Swift Export, calling Kotlin from Swift on iOS is smoother and no longer requires the ObjC header.

But don't over-optimize: cinterop binds fine to C APIs, but binding complex callback-based Objective-C class libraries (like old camera SDKs) is still painful — you'll likely need a Swift wrapper that Kotlin calls on top. Three layers.

Mini-programs: Lowest Ceiling, and It Can't Be Bypassed

This is the most underappreciated hard constraint on the mini-program side:

Capability WeChat Mini-program Alipay/Douyin Conclusion
BLE wx.getBluetoothAdapter Extremely inconsistent support Heavy conditional compilation + fallbacks
NFC wx.getNFCAdapter Essentially none Can only jump to native app / H5
Deep camera control Limited Limited Impossible
File system Restricted sandbox Unsupported Temporary files only
Background tasks None (within mini-program lifecycle) None Mini-programs inherently have no concept of background tasks
Native SDK calls Requires mini-program native plugin, publishing to open platform + review Per-platform adaptation Extremely high cost, weeks-long cycles

So for hardware-heavy business, the mini-program's role can only be a lightweight entry point: scanning, viewing reports, booking appointments, jumping to native app or H5 for complex flows.

If you set "one codebase for three platforms" as the goal at kickoff, while hardware capabilities only exist on the App side — that plan is wrong from day one. Not an execution problem; an architecture problem.

Ledger #2 Summary

Hardware extension cost ranking (low to high):

Mini-program (limited)  <  RN / Flutter (bridge + community plugins)  <  KMP + cinterop  <  Native

But the real ranking also depends on whether you have a fallback: if the hardware SDK only ships .so, you'll have to write native modules eventually. At that point the "framework choice" decision becomes irrelevant the moment hardware integration begins — you need a native project to exist regardless. That's actually a good thing: confirming this fact early saves more time than going in circles inside a framework.


4. Ledger #3: Performance Optimization Cost

This ledger asks: when a problem appears in production, how long does it take to locate and fix it?

App Side: The Gap Between the Three Frameworks Is Already Small

This corrects many old impressions. In 2026, the statements "RN is slow" and "Flutter has large package size" are no longer decisive factors in framework selection.

Conclusion: for pure performance-sensitive scenarios (3D, animation, heavy computation), none of the three frameworks should be chosen; choose native. The performance gap between cross-platform frameworks is far smaller than the gap caused by "your code being badly written".

What really determines optimization cost is ecosystem maturity:

Mini-program Side: The Bottleneck Isn't the Framework, It's Communication

The core contradiction of mini-program performance is logic layer and view layer separation. A single setData call serializes cross-thread, passing the entire object from logic to view layer before rendering.

Typical crash scenario:

20 items in a list, 3 fields each, frequent updates during scroll → setData carries the whole array → frame drops

Cross-platform frameworks (Taro / uni-app) compile to WXML + WXSS + JS. They inherit the mini-program's ceiling; they don't break through it. What you write with Taro behaves almost identically at runtime to what you'd write with native mini-program code.

There are only a few performance must-dos on the mini-program side, but each must be done:

  1. setData partial update: send incremental fields, not entire array objects.
  2. Subpackaging: the 2MB main-package limit is a hard red line. Taro injects a runtime (official docs say about 80KB runtime, but in practice main package delta is often +150KB), uni-app's delta is smaller — the first cost a cross-platform framework pays on mini-programs is package size.
  3. Virtual list for long lists (recycle-view), don't render everything.
  4. Avoid frequent setData; merge updates with nextTick.
  5. Skyline can improve rendering, but it's WeChat-only, not universal.

uni-app x's "Steam Mode" Deserves Separate Mention

uni-app x uses UTS to compile directly to Kotlin / Swift / ArkTS, skipping the WebView layer on the App side — both logic and rendering layers are native. Official comparison: rendering 4050 view/text elements simultaneously, Android native 505ms vs uni-app x 273ms (1.85x), iOS native 325.76ms vs 167ms (1.95x), HarmonyOS 804ms vs 267ms (3x).

Note this is a vendor benchmark, tested on Xiaomi Fold4 and iPhone SE. There's a real qualitative improvement on the App side. But on the mini-program side, uni-app x still runs through the mini-program runtime, so this advantage doesn't materialize at all on mini-programs.

Ledger #3 Summary

The true order of optimization cost isn't "who's faster", but:

Hot reload quality > engine absolute performance > first-screen time > package size

Because the vast majority of production performance problems are solved by "change code, retest", not "switch rendering engine". A framework that lets you see the effect of a one-line change immediately is the one that saves the most optimization cost. Flutter remains first on this point.


5. Ledger #4: Long-term Maintenance Cost

The previous ledgers are quantifiable; this one is the hardest to quantify, but it determines whether the project survives three years or gets rewritten.

Upgrade Cadence and Breaking Changes

Framework Major Version Cadence Breaking Change Severity Migration Cost
React Native About 1–2/year High 0.82 removed old Bridge — a hard migration; any project with native modules is affected
Flutter About 1/year Medium 3.x widget split, minimum version raises are gradual
Kotlin Multiplatform Follows Kotlin majors Low–Medium expect/actual signature changes, klib format updates
uni-app x Early, fast Medium UTS type system still evolving; docs mainly Chinese, less English
Taro 4 Medium Medium Compile-time/runtime hybrid means cross-major-version config changes

React Native's history of breaking changes is its biggest long-term deduction. But there's a hedge: Expo wraps version management, build, OTA updates, and upgrade scripts; SDK 55 even comes with Claude Code upgrade skills. Whether you use bare RN or Expo can multiply your maintenance cost by many times. New projects should go straight to Expo.

Talent and Hiring

Stack Overflow 2025 survey: JavaScript 66%, TypeScript 43.6%, Dart only 5.9%.

This should be weighed early. A great framework is on paper if you can't hire for it.

Hidden Cost of Three-Platform Sync

The biggest hidden cost of cross-platform is not technical; it's that the same bug must be fixed three times across three platforms, and the test matrix triples.

Shared code reduces UI-layer bug count, but amplifies another risk: one change breaks all three platforms. A change to a shared network layer brings all three down, and troubleshooting means watching three runtimes' logs simultaneously.

Conversely, if you structure by layers (described later) — UI independent, logic shared — the blast radius of bugs is controllable. That itself is a form of cost control.

Upstream Dependencies

Community and Enterprise Backing (Just to Keep in Mind)

An obscure but important signal: per Appfigures, among top iOS non-game apps, RN (1350) has more than Flutter (1184), with download share RN about 47% vs Flutter about 38%, and revenue about 41% vs 32%. This is consistent with "Dart has fewer developers, JS has more".


6. Mini-program Must Be Calculated Separately, Because It Isn't a "Platform"

All four ledgers above assume you're talking about the App side. But if the requirement includes a mini-program, you need an independent axis.

The reality for mini-programs:

So the optimal solution on the mini-program side is often not "share code with the App", but "share design language and business rules with the App". Forcing view-layer code sharing usually makes both sides uncomfortable.

Choices on the mini-program side, by team background:

Team Background Recommendation Reason
Vue ecosystem uni-app / uni-app x Most complete Chinese docs, plugin market 8000+, mature conditional compilation, fewer multi-platform difference code
React ecosystem / also need RN Taro 4.x Mature RN pipeline, good type support, can output App + mini-program + H5 simultaneously
Have native app, need mini-program container FinClip / mPaaS WeChat mini-program runs in your own app with zero modification, SDK about 3MB, compliance requirement for finance/government
Large company custom infra Kuikly KMP base, "one code five platforms", AOT compiled native binaries

A counterintuitive but practical tip: performance optimization gains on mini-programs often outweigh the gains from choosing one cross-platform framework over another. Spending a week optimizing setData is worth more than agonizing over Taro vs uni-app.


7. The Unavoidable Fourth Platform in 2026: HarmonyOS

If your users are in China, HarmonyOS must be in the budget. In 2026, major domestic apps are basically all doing HarmonyOS versions. It's no longer a question of "whether" but "how expensive a route".

Three paths:

  1. Native ArkTS (Huawei official route): best performance, most authentic ecosystem, but adds a whole new tech stack — three platforms becomes four.
  2. Kotlin Multiplatform + ArkTS interop: Kotlin community has progress on HarmonyOS target support; business logic can be shared.
  3. Third-party multi-platform:
    • Kuikly (Tencent open-source, KMP base): AOT compiles native binaries, targets Android/iOS/HarmonyOS/H5/mini-program, claims Android SDK about 300KB, iOS about 1.2MB, H5 FCP 87ms.
    • Taro 4: HarmonyOS via source-level conversion + C-API rendering, official claim about 85% native performance.
    • uni-app x: officially prioritized for HarmonyOS, UTS compiles directly to ArkTS, HarmonyOS rendering in steam mode 267ms vs native 804ms (nova12 test device).

My judgment: don't try to commit to "one code, five platforms" all on a single framework for HarmonyOS. The core need on HarmonyOS is "feature parity + launch compliance", not "extreme experience". Using a mature path (ArkTS or official KMP support) to roll out core features is safer than betting on early versions of third-party frameworks. The maturity uncertainty of new frameworks should be priced in as a risk premium.


8. What You Should Really Copy Isn't a Framework, It's Layered Architecture

Back to the project at the start. In the end we chose neither Flutter, RN, nor uni-app x.

We layered the architecture, using different frameworks for different layers, each optimized according to its own cost logic:

┌─────────────────────────────────────────────┐
│ L0  Design system layer (cross-platform shared)      │
│   Design tokens: colors / type / spacing / radius / animation curves │
│   Component spec docs + screenshot regression            │
├─────────────────────────────────────────────┤
│ L1  Pure logic layer (cross-platform shared 100%)      │
│   Data models / network layer / local cache / business rules │
│   Validation / state machines / error mapping            │
│   → Kotlin (because we connect to a Kotlin backend)      │
├─────────────────────────────────────────────┤
│ L2  Platform capability abstraction layer (unified interfaces, per-platform impl) │
│   Location / storage / push / login / payment / analytics │
│   expect/actual or per-platform implementations of same interface │
├─────────────────────────────────────────────┤
│ L3  UI layer (each platform evolves independently)      │
│   Android: Compose  │  iOS: SwiftUI                     │
│   Mini-program: native / Taro / uni-app                 │
│   Visual consistency via L0 tokens, not shared view code │
├─────────────────────────────────────────────┤
│ L4  Native capability layer (never sinks down, per-platform direct) │
│   Bluetooth / NFC / national crypto / scanning / fingerprint / camera low-level │
└─────────────────────────────────────────────┘

The beauty of this structure: each layer can be decided and replaced independently.

"One codebase" is never the goal; "one set of rules + N renderings" is. The former gets you held hostage by the framework; the latter lets you switch frameworks at will.

Specifically, my recommendations:

Scenario A: Android + iOS + mini-program, team has Kotlin / backend-Kotlin experience

Scenario B: Android + iOS + mini-program, team is frontend (React/TS)

Scenario C: Strong design-driven, strong animation, brand-heavy

Scenario D: Only App dual-platform, already has significant native code


9. Selection Quick Reference Table

Your Situation Choose Don't Choose
Need three platforms, hardware-heavy, Kotlin team KMP shared logic + native UI per platform + independent mini-program framework pure uni-app x end-to-end (hardware won't run)
Need three platforms, frontend team RN + Expo + Taro Flutter (extra Dart language, harder hiring)
Only multi mini-program uni-app x (if hardware needed) / Taro (React team) native mini-program written multiple times (maintenance multiplied by platform count)
Strong visuals + strong animation Flutter RN (high visual consistency cost)
Extreme performance / 3D / video editing Native (+ KMP shared logic) any UI-shared solution
Lots of existing native code KMP progressive migration rewrite from scratch with cross-platform UI framework
Single-platform users Native any cross-platform (pure loss)
HarmonyOS is a hard requirement ArkTS or official KMP support betting on early third-party one-code-five-platform

I'll emphasize the last line separately: if your users are on one platform only, cross-platform is a pure loss. Introducing an extra runtime layer, an extra build chain, extra hiring/training costs, with zero reuse to show for it — that's not a technical problem, it's a math problem.


10. Final Words

Back to the four ledgers, condensed into four sentences you can take straight to a meeting:

  1. Custom component ledger: visual consistency comes from design tokens and spec docs, not shared view code. Flutter makes consistency cheapest; RN makes native feel cheapest; KMP's native feel is most expensive — no, it's not expensive, it's that you have to write two UIs yourself.
  2. Hardware extension ledger: hardware always lands on native. Cross-platform frameworks only give you a smoother bridge. List hardware capabilities on day one and draw them into the architecture diagram; that's an order of magnitude cheaper than retrofitting bridges later.
  3. Performance optimization ledger: the gap between cross-platform frameworks is far smaller than the gap caused by badly-written code. Hot reload quality is what actually saves money.
  4. Long-term maintenance ledger: version breaking changes (RN worst), talent pool (Dart narrowest), platform version tracking — these three decide your project's fate three years out, more than any benchmark.

As for "2026's most popular" — Flutter is strong on download share and new app counts, RN still leads in top apps and revenue, KMP is the fastest-growing and validated by big companies, and on the mini-program side uni-app has the thickest ecosystem while Taro is more aggressive on RN pipeline and HarmonyOS.

But what should really be popular is layering: letting each layer make decisions by its own cost logic, rather than letting one framework's strengths cover all layers.

Frameworks change, versions rotate every few months. Architecture layering is the part you can still modify three years from now.


If you're working on a similar selection, feel free to share in the comments which pitfall you hit — especially the hardware layer. I bet you've also had that moment where the vendor only provides an aar and framework.

Comments

Top 1 of 6 from juejin.cn, machine-translated. The original thread is authoritative.

小飞码

We're all going AI now, why bother with unified development? Just do native development everywhere. That way, for AI, it's actually easier — each side decoupled, no conflicts.

疯华整猫

But in reality, managers who don't understand pretend to know, then blindly direct the experts below to achieve their own goals, like having Android implement a feature that already exists on iOS and also keep performance consistent [facepalm]

Ying影  → 疯华整猫

For consistency, an HTML wrapper is the ultimate answer.