网站开发方案目录asp网站和php网站
2026/2/4 17:45:16 网站建设 项目流程
网站开发方案目录,asp网站和php网站,网站更改域名,石龙镇住房规划建设局网站flutter oh项目新手从0到1的保姆级教程 前言 很多的坑踩过才知道#xff0c;保姆级教程就是无脑跟随作者的教程走#xff0c;不要有自己的想法。请注意#xff0c;如果你读到这个文章#xff0c;请必须严格按照文档顺序操作#xff0c;保证一把过#xff0c;如果有个人…flutter oh项目新手从0到1的保姆级教程前言很多的坑踩过才知道保姆级教程就是无脑跟随作者的教程走不要有自己的想法。请注意如果你读到这个文章请必须严格按照文档顺序操作保证一把过如果有个人思想跳过部分章节请自己排坑。请准备好鸿蒙5的设备必须要鸿蒙5及以上系统其低于这个版本的系统就别看本文章了一、配置开发环境1、下载DevEco Studio编辑器默认安装不要有自己的想法默认就行2、配置ohpm 和 hvigorw 环境变量将ohpm、hvigorw添加到系统 PATHC:\Program Files\Huawei\DevEco Studio\tools\ohpm\binC:\Program Files\Huawei\DevEco Studio\tools\hvigor\bin测试命令全局cmd操作ohpm -v项目里面操作hvigorw -v3、配置HOS_SDK_HOME环境变量在用户、系统环境变量里面新增一个HOS_SDK_HOME变量地址为你编辑器里面的地址并且创建2个文件夹分别为openharmony、hmscore4、配置DEVECO_SDK_HOME环境变量在“系统变量”中点击“新建”添加以下内容变量名DEVECO_SDK_HOME变量值DevEco SDK的安装路径例如C:\Huawei\DevEcoStudio\SDK5、配置HDC环境变量安装好DevEco Studio之后能在setting中看到下载的路径可能会自动配置hdc变量配置你下载的api的地址但是可以自己配置或检查将hdc配置到系统path中请到自己的目录中查看我的路径为C:\Users\yang\AppData\Local\OpenHarmony\Sdk\15\toolchains6、配置node环境变量用到了node在DevEco中有提供安装直接在系统变量的path中添加C:\Program Files\Huawei\DevEco Studio\tools\node7、下载oh的flutter本次开发使用的3.27.4版本用git clone下载不要下载zip不要有自己的想法请遵循保姆级教程逻辑git clone -b oh-3.27.4-dev https://gitcode.com/openharmony-tpc/flutter_flutter.git8、下载android studio官网下载这一步是拿来写代码用的编辑器如果不想使用可以用其他编辑器9、配置flutter国内环境变量添加Pub 镜像地址环境变量PUB_HOSTED_URL添加 Flutter SDK 镜像地址环境变量FLUTTER_STORAGE_BASE_URL$env:PUB_HOSTED_URLhttps://pub.flutter-io.cn$env:FLUTTER_STORAGE_BASE_URLhttps://storage.flutter-io.cnimageimage二、初始化环境1、 初始化flutter在下载好的oh flutter根路径中打开命令行运行命令flutter doctor这一步会自动下载初始化该版本的dart2、检查项目环境在你的项目中打开命令行运行命令flutter doctor -v如果提示你打x的根据提示安装需要的配置和环境如果通过应该是显示如下复制代码(base) D:\github\flutter_use git:[yhk_oh]flutter doctor -v╔════════════════════════════════════════════════════════════════════════════╗║ Welcome to Flutter! - https://flutter.dev ║║ ║║ The Flutter tool uses Google Analytics to anonymously report feature usage ║║ statistics and basic crash reports. This data is used to help improve ║║ Flutter tools over time. ║║ ║║ Flutter tool analytics are not sent on the very first run. To disable ║║ reporting, type flutter config --no-analytics. To display the current ║║ setting, type flutter config. If you opt out of analytics, an opt-out ║║ event will be sent, and then no further information will be sent by the ║║ Flutter tool. ║║ ║║ By downloading the Flutter SDK, you agree to the Google Terms of Service. ║║ The Google Privacy Policy describes how data is handled in this service. ║║ ║║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and ║║ crash reports to Google. ║║ ║║ Read about data we send with crash reports: ║║ https://flutter.dev/to/crash-reporting ║║ ║║ See Googles privacy policy: ║• Framework revision 4c5ae9f27d (6 weeks ago), 2025-10-11 11:28:53 0800• Engine revision e672b006cb• Dart version 3.6.2• DevTools version 2.40.0• If those were intentional, you can disregard the above warnings; however it is recommended to use git directly to perform update checks andupgrades.[√] HarmonyOS toolchain - develop for HarmonyOS devices• OpenHarmony Sdk at C:\Users\yang\AppData\Local\OpenHarmony\Sdk, available api versions has [20:default, 18:18, 15:15]• Ohpm version 5.3.2• Node version v18.20.8• Hvigorw binary at C:\Program Files\Huawei\DevEco Studio\tools\hvigor\bin\hvigorw[√] Windows Version (Installed version of Windows is version 10 or higher)[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)• Android SDK at C:\Users\yang\AppData\Local\Android\sdk• Platform android-36, build-tools 35.0.0• Java binary at: C:\Users\yang\AppData\Local\Programs\Android Studio\jbr\bin\java• Java version OpenJDK Runtime Environment (build 17.0.110--11852314)• All Android licenses accepted.[√] Chrome - develop for the web• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.20)• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community• Visual Studio Community 2022 version 17.14.36705.20• Windows 10 SDK version 10.0.26100.0[√] Android Studio (version 2024.1)• Android Studio at C:\Users\yang\AppData\Local\Programs\Android Studio• Flutter plugin can be installed from:https://plugins.jetbrains.com/plugin/9212-flutter• Dart plugin can be installed from:https://plugins.jetbrains.com/plugin/6351-dart• Java version OpenJDK Runtime Environment (build 17.0.110--11852314)[√] IntelliJ IDEA Ultimate Edition (version 2025.2)• IntelliJ at C:\Users\yang\AppData\Local\Programs\IntelliJ IDEA Ultimate• Flutter plugin can be installed from:https://plugins.jetbrains.com/plugin/9212-flutter• Dart plugin can be installed from:https://plugins.jetbrains.com/plugin/6351-dart[√] VS Code (version 1.105.1)• VS Code at C:\Users\yang\AppData\Local\Programs\Microsoft VS Code• Flutter extension can be installed from:https://marketplace.visualstudio.com/items?itemNameDart-Code.flutter[√] Connected device (3 available)• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.26200.7171]• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.135• Edge (web) • edge • web-javascript • Microsoft Edge 142.0.3595.94[√] Network resources• All expected network resources are available.! Doctor found issues in 1 category.复制代码3、下载flutter插件在Android studio中下载flutter插件并将你下载好的flutter根路径配置进去4、 打开DevEco Studio这一步可能会自动下载部分环境初始化5、 打开Android studio这一步可能会自动下载部分环境初始化三、 设备连接1、 设备准备请准备好鸿蒙5的设备必须要鸿蒙5及以上系统其低于这个版本的系统就别装了2、 启用开发者选项和 USB 调试开发者选项开启请在关于本机中软件版本连续点击5次开启确保已开启设置 → 系统和更新 → 开发人员选项开启 USB调试开启 仅充电模式下允许调试如果有3、设备连接HDCHarmonyOS Device Connector是鸿蒙的设备连接工具类似于 Android 的 ADB。命令行中输入hdc list targets 如果设备已连接会显示设备的序列号。如果没有连接则不会显示任何设备。四、项目初始化3、 在Android studio中创建或打开flutter项目创建好项目之后输入flutter pub get下载基础依赖4、 初始化oh环境在项目的控制台中输入flutter create --platformsohos .为现有项目添加 HarmonyOS 平台5、 验证项目控制台输入flutter devices查看项目支持的平台6、 引入依赖特殊的oh包需要单独的引入注意如果包为全平台通用包不需要单独引入包来源即包中没有Android、iOS等平台文件夹如果存在就要单独创建开鸿这边给出的方式为flutter_zxing:git:url: https://gitcode.com/openharmony-sig/fluttertpc_flutter_zxing.gitdevice_info_plus: # 设备型号、系统版本git:url: https://gitcode.com/openharmony-sig/flutter_plus_plugins.gitpath: packages/device_info_plus/device_info_plus7、 启动项目输入命令这2个命令都会启动第一个命令会自动寻找oh设备flutter runflutter run -d ohos启动过程如果有多个设备会让选择使用哪个设备进行启动或者Android studio直接点击运行会自动识别并编译启动oh环境四、 底层开发如果你的包没有支持oh但是你又想使用支持1、 下载包github中下载你的包并且打开项目2、 创建oh平台在项目中创建oh平台3、 oh支持在原有的逻辑中编码oh平台逻辑4、 引入包在项目初始化段落中依赖引入章节方式引入五、异常问题1、提示路径映射问题Make sure the srcPath in the hvigorconfig.ts file of the project is a relative path.

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询