frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Detailed Guide to Developing Flutter Plugins for HarmonyOS

3•flfljh•5h ago
# Detailed Guide to Developing Flutter Plugins for HarmonyOS

## 0. Environment Setup

*Prerequisite*: Configure HarmonyOS Flutter environment *Reference*: [HarmonyOS Flutter Environment Setup Guide](https://juejin.cn/post/7317214081261207603) *Note*: Downloading and compiling the engine is time-consuming. Pre-built engines are available upon request.

------

## 1. Obtain Original Plugin Code

``` git clone <original_plugin_repository> ```

------

## 2. Generate OHOS Directory

``` # Option 1: Direct generation (may fail) flutter create -t plugin --platforms ohos

# Option 2: Create demo project and copy flutter create -t plugin --platforms ohos demo cp -r demo/ohos ./ ```

------

## 3. Configure Local Dependency

Add local dependency in `pubspec.yaml`:

``` dependencies: your_plugin: path: ../path_to_plugin ```

![iwEcAqNwbmcDAQTRCQAF0QS4BrDBDM9ETs38UAcIagyL5gAAB9IGLKvECAAJomltCgAL0gALGaw.png_620x10000q90](https://p.ipic.vip/kjme9r.jpg)

## 4. Build Plugin Package

```bash flutter build hap \ --local-engine-src-path /path/to/ohos_flutter/src \ --local-engine ohos_release_arm64 ```

*Successful Output*:

```markdown √ Built build/hap/release/entry-release.hap (XX.XMB) ```

------

## 5. Verify Generated Files

After successful build:

![1](https://p.ipic.vip/6k3z3k.png)

## 6. Locate Plugin HAR Package

Plugin output directory:

```markdown your_plugin/ohos/build/outputs/ └── har └── your_plugin_ohos.har # Plugin package ```

![2](https://p.ipic.vip/2cjnbx.png)

## 7. Add HAR to Demo Project

Copy HAR to demo project:

bash

```bash cp your_plugin_ohos.har demo_portal/module/ohos/libs/ ```

------

![3](https://p.ipic.vip/n9sgfo.png)

## 8. Configure HAR Dependency

![4](https://p.ipic.vip/wlkxik.png)

## 9. Initialize Plugin

![5](https://p.ipic.vip/ee33ah.png)

## 10. Test Plugin Functionality

![6](https://p.ipic.vip/4fy0hk.png)

![7](https://p.ipic.vip/w30wew.png)

## 11. Develop Native Implementation

Follow these steps for native development:

1. Analyze existing iOS/Android native logic 2. Create HarmonyOS equivalent in `ohos/src/main/cpp/` 3. Implement platform interface:cpp

Comments

mmarian•1h ago
I'm curious if there are any business opportunities in the Harmonyos market. From what I can tell, it's as competitive as the other app marketplaces.
lordkrandel•39m ago
Yeah, censorship included

Fedora 44 Looks to Drop I686 Support: No More Multi-Lib / x86 32-Bit Packages

https://www.phoronix.com/news/Fedora-43-Change-No-i686
1•rcarmo•44s ago•0 comments

Universum Mechanical Watch Wristwatches

https://ifdesign.com/en/winner-ranking/project/universum-mechanical-watch/620684
1•Bluestein•3m ago•0 comments

Rocket Two big Asian reuse milestones, Vandenberg becomes SpaceX west

https://arstechnica.com/civis/threads/rocket-report-two-big-asian-reuse-milestones-vandenberg-becomes-spacex-west.1507980/page-3
1•Bluestein•5m ago•0 comments

Reading NFC Passport Chips in Linux

https://shkspr.mobi/blog/2025/06/reading-nfc-passport-chips-in-linux/
2•robin_reala•7m ago•0 comments

Perplexity enables Veo 3-powered video creation on X

https://twitter.com/AskPerplexity/status/1935759056209428531
2•willmarquis•11m ago•0 comments

Show HN: I gave it my 100%, you will not believe what I came up with

https://enchanted-work-037926.framer.app/
2•Divyansh_13•15m ago•0 comments

ChatGPT Is Becoming a Religion

https://www.youtube.com/watch?v=zKCynxiV_8I
2•cmsefton•16m ago•0 comments

How I Passed the Cissp: My Personal Experience (2023)

https://techkettle.blogspot.com/2022/12/cissp-you-dont-have-to-study-everything.html
1•elsadek•18m ago•0 comments

Show HN: TDD your own query engine with rgSQL

https://github.com/technicaldeft/rgsql
1•zetter•18m ago•0 comments

From SwiftUI Views to Reusable Components: The Root MVVM Way

https://matteomanferdini.com/swiftui-massive-reusable-views/
1•skreep•20m ago•1 comments

WebBench: Browser Agent Benchmarks

https://github.com/Halluminate/WebBench
1•handfuloflight•23m ago•0 comments

FreightView – a TUI app for inspecting Docker images, written in Rust

https://crates.io/crates/freightview
1•GranularRecipe•25m ago•0 comments

What the Heck Just Happened?

https://code.thheller.com/blog/shadow-cljs/2025/06/24/what-the-heck-just-happened.html
1•Bogdanp•25m ago•0 comments

Why a Classic MCP Server Vulnerability Can Undermine Your Entire AI Agent

https://www.trendmicro.com/en_us/research/25/f/why-a-classic-mcp-server-vulnerability-can-undermine-your-entire-ai-agent.html
1•janandonly•27m ago•0 comments

AI 'Upgrades' Would Ruin Kung Fu Classics

https://www.bloomberg.com/opinion/articles/2025-06-24/ai-upgrades-would-ruin-kung-fu-classics
2•helsinkiandrew•27m ago•1 comments

LiteDB: Simple db for JavaScript, no signup

https://litedb.vercel.app/
2•alokjnv10•30m ago•0 comments

Show HN: Scream to Unlock

https://github.com/Pankajtanwarbanna/scream-to-unlock
3•pankajtanwar•33m ago•0 comments

Repomix

https://repomix.com/
1•handfuloflight•39m ago•0 comments

Show HN: I built and launched labubu wallpaper website

https://labubuwallpics.com
2•qinggeng•40m ago•0 comments

Imagen 4 is now available in the Gemini API and Google AI Studio Blog

https://developers.googleblog.com/en/imagen-4-now-available-in-the-gemini-api-and-google-ai-studio/
3•tosh•42m ago•0 comments

Four astronauts launch to the ISS as NASA grapples with leak issues

https://www.cnn.com/2025/06/25/science/axiom-space-iss-leak-zvezda-module
2•jeffwass•42m ago•0 comments

AI more likely to create 'yes-men on servers' than any scientific breakthroughs

https://fortune.com/2025/06/20/hugging-face-thomas-wolf-ai-yes-men-on-servers-no-scientific-breakthroughs/
30•Bluestein•42m ago•10 comments

13-Year-Old Author Joshua Hart Launches Site for His Books

1•Joshua_Hart•45m ago•0 comments

Paradox in Evolution–and It May Become the Next Rule of Biology

https://www.popularmechanics.com/science/animals/a65104271/biology-evolution-paradox/
4•Bluestein•45m ago•0 comments

The burger was made in a lab from cow cells. Should it be served in restaurants?

https://www.bbc.co.uk/news/articles/cgrxnlpln24o
2•mmarian•45m ago•0 comments

Anthropic won't fix a bug in its SQLite MCP server

https://www.theregister.com/2025/06/25/anthropic_sql_injection_flaw_unfixed/
2•beardyw•45m ago•1 comments

Jan-Nano-128k: Empowering deeper research through extended context understanding

https://huggingface.co/Menlo/Jan-nano-128k
1•handfuloflight•48m ago•0 comments

Huawei:The future is fiber-to-the-room, which China has and the rest of us don't

https://www.theregister.com/2025/06/23/huawei_chair_eric_xu_vision/
2•KnuthIsGod•51m ago•0 comments

Google could be forced to change UK search as watchdog takes steps

https://www.theguardian.com/technology/2025/jun/24/google-uk-search-uk-watchdog-cma
1•beardyw•54m ago•0 comments

I've made a Chrome Extension every founder needs and it is free

1•coursecrumbs•56m ago•0 comments