Flutter开发HarmonyOS鸿蒙Next应用的时候路径长度超过最大限制259如何解决

发布于 1周前 作者 htzhanglong 最后一次编辑是 5天前 来自 Flutter

Flutter开发HarmonyOS鸿蒙Next应用的时候路径长度超过最大限制259如何解决

错误信息

错误信息 在编译构建的过程中,总是因为oh_modules.ohpm\下某个目录的路径太长而abort,请问是否有方法可以缩短该目录路径,比如不要一直拼接,像图片中说的Configure a shorter target name?

环境:

  • Windows 10
  • flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[!] Flutter (Channel master, 3.7.12, on Microsoft Windows [版本 10.0.19045.4046], locale zh-CN)
    • Flutter version 3.7.12 on channel master at D:\env\openharmony\flutter_flutter
    ! Upstream repository https://gitee.com/openharmony-sig/flutter_flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://gitee.com/openharmony-sig/flutter_flutter.git to dismiss this error.
    • Framework revision bea46a38ab (8 weeks ago), 2024-01-17 09:17:02 +0000
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] OpenHarmony toolchain - develop for OpenHarmony devices
    • OpenHarmony Sdk location: D:\env\openharmony\ohos-sdk, available api versions has [10]
    • hdc version 1.3.0
    • ohpm version 1.2.0
    • signTool location:D:\env\openharmony\developtools_hapsigner\autosign

[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)

[X] Android toolchain - develop for Android devices
    X ANDROID_HOME = D:\env\Android
      but Android SDK not found at this location.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] Connected device (3 available)
    • 000000000000000000000000121601ad (mobile) • 000000000000000000000000121601ad • ohos-arm64     • Ohos OpenHarmony-4.0.10.13 (API 10)
    • Windows (desktop)                         • windows                          • windows-x64    • Microsoft Windows [版本 10.0.19045.4046]
    • Edge (web)                                • edge                             • web-javascript • Microsoft Edge 122.0.2365.80

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 6 categories.
2 回复

flutter缓存目录需要和项目目录在一个磁盘下面

一个盘符下面

回到顶部