我在尝试构建或运行我的 flutter 应用程序时收到此错误。这有点令人沮丧,因为我似乎不知道问题出在哪里。
+9 ms] [ +15 ms] Target debug_android_application failed: FileSystemException: Cannot copy file to
'/Users/User/FlutterProjects/heala_patient_app/android/app/build/intermediates/flutter/debug/flutter_assets/androi
d/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/flutter/debug/flutter_asset
s/android/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/flutter/debug/flutt
er_assets/android/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/flutter/deb
ug/flutter_assets/android/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/flu
tter/debug/flutter_assets/android/app/build/intermediates/merged_assets/debug/out/flutter_assets/android/app/build
/intermediates/merged_assets/debug/out/flutter_assets/android/app/build/intermediates/merged_assets/debug/out/flut
ter_assets/android/app/build/intermediates/merged_assets/debug/out/flutter_assets/android/app/build/intermediates/
merged_assets/debug/out/flutter_assets/android/app/build/intermediates/merged_assets/debug/out/flutter_assets/.env
', path =
'/Users/User/FlutterProjects/heala_patient_app/android/app/build/intermediates/flutter/debug/flutter_assets/androi
d/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/flutter/debug/flutter_asset
s/android/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/flutter/debug/flutt
er_assets/android/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/flutter/deb
ug/flutter_assets/android/app/build/intermediates/flutter/debug/flutter_assets/android/app/build/intermediates/mer
ged_assets/debug/out/flutter_assets/android/app/build/intermediates/merged_assets/debug/out/flutter_assets/android
/app/build/intermediates/merged_assets/debug/out/flutter_assets/android/app/build/intermediates/merged_assets/debu
g/out/flutter_assets/android/app/build/intermediates/merged_assets/debug/out/flutter_assets/android/app/build/inte
rmediates/merged_assets/debug/out/flutter_assets/.env' (OS Error: File name too long, errno = 63)
路径的最大字节数为 4096。文件名的最大字节数为 255 字节。 所以,这意味着:因为该字符等于 2 个字节,所以它将类似于: 文件名的最大字符数 = 255 字节 / 字符的 2 字节数 = 127 个字符。 路径的最大字符 = 4096 字节 / 字符的 2 字节 = 2048 字符。
删除
android/build
文件夹并重新运行