# How do I create a Flutter app for HarmonyOS? > Set up the Flutter OpenHarmony fork, create a project with the ohos platform, run it on a device, build a HAP, and find ready-made plugins in the CPF-Flutter community on GitCode. Source: https://ohosify.com/en/blog/flutter-harmonyos-app Published: 2026-10-02 Verified: 2026-10-02 (OpenHarmony 6.1.1 Release, API 24) Author: Ohosify **Short answer:** Flutter does not run on HarmonyOS with the standard SDK. Clone the OpenHarmony-adapted Flutter fork from GitCode, check out a release branch, set a few environment variables, and create your project with `flutter create --platforms ohos`. Then use `flutter run` for development and `flutter build hap --release` for a package. ## What is Flutter for HarmonyOS? The community-maintained **CPF-Flutter** organization on GitCode hosts a Flutter fork that adds an `ohos` target (a Flutter engine and tool that produce HarmonyOS/OpenHarmony apps). Your Dart code and widgets stay the same. The platform layer, written in ArkTS, replaces the Android/iOS embedders. ## What do you need first? - DevEco Studio and the HarmonyOS/OpenHarmony SDK. See [How to install DevEco Studio](/en/blog/install-deveco-studio). - Git. - A device or emulator, visible with `hdc`. See the [hdc command guide](/en/blog/hdc-command-guide). ## How do I set up the Flutter fork? Clone the repository and check out a release branch: ```bash git clone https://gitcode.com/CPF-Flutter/flutter_flutter.git cd flutter_flutter git checkout oh-3.35.7-release ``` Set the environment variables (the storage and pub mirrors are hosted in China): ```bash export FLUTTER_STORAGE_BASE_URL=https://flutter-ohos.obs.cn-south-1.myhuaweicloud.com export PUB_HOSTED_URL=https://repo.huaweicloud.com export HOS_SDK_HOME=/path/to/ohos-sdk export OHOS_SDK_HOME=$HOS_SDK_HOME export PATH=$PATH:/path/to/flutter_flutter/bin ``` Then verify the setup: ```bash flutter doctor ``` Troubleshooting notes from the project documentation: - "The SDK license agreement is not accepted": run `./ohsdkmgr install --accept-license`. - After changing `FLUTTER_STORAGE_BASE_URL`, delete `bin/cache`. - Run `flutter clean` after changing the environment. ## How do I create and run the app? ```bash flutter create --platforms ohos,android,ios --org com.example myapp cd myapp flutter run --debug ``` The `ohos` directory in the project is a normal HarmonyOS project that DevEco Studio can open. Hot reload works as in regular Flutter. Running on a physical device needs a signing configuration; see the signing step in [Your first ArkTS app](/en/blog/first-arkts-app). For a plugin or an add-to-app module: ```bash flutter create -t plugin --platforms ohos my_plugin flutter create -t module my_module ``` ## How do I build a package? ```bash flutter build hap --release flutter install -t ``` ## What is in the CPF-Flutter organization? Page 2 of the [organization's repository list](https://gitcode.com/org/CPF-Flutter/repos?page=2) contains, among others: | Repository | Purpose | |---|---| | `flutter_samples` | Flutter's official samples extended with OpenHarmony adaptation and docs (60+ samples) | | `fluttertpc_file_picker` | Native file manager picker with extension filtering | | `fluttertpc_file_preview` | File preview plugin | | `fluttertpc_video_thumbnail` | Thumbnails from video files | | `fluttertpc_flutter_zxing` | Barcode and QR scanning and generation (ZXing) | | `fluttertpc_flutter_webrtc` | WebRTC | | `fluttertpc_agora_rtc_engine` | Live interaction and audio playback with Agora | | `fluttertpc_audio_service`, `flutter_audioplayers`, `flutter_audio_session` | Audio playback and sessions | | `fluttertpc_tts_plugin` | Text to speech | | `fluttertpc_wifi_iot` | Wi-Fi connection and hotspot (AP, STA) | | `fluttertpc_flutter_downloader` | Download task management | | `fluttertpc_FlutterUpgrader` | App upgrade | | `fluttertpc_flutter_keychain` | Secure storage | | `fluttertpc_angle` | ANGLE: OpenGL ES calls translated to Vulkan | | `flutter_multidevice_layout_scenepkg` | Layout adaptation for foldables, tablets and phones | Plugin names and versions change often, so check each repository's README before adding it to `pubspec.yaml`. ## Next steps - [What is ArkTS?](/en/blog/what-is-arkts) - [Your first ArkTS app](/en/blog/first-arkts-app) - [OpenHarmony vs HarmonyOS](/en/blog/openharmony-vs-harmonyos)