找不到“Frameworks/App.framework/flutter_assets”的资产路径
Posted
技术标签:
【中文标题】找不到“Frameworks/App.framework/flutter_assets”的资产路径【英文标题】:Failed to find assets path for "Frameworks/App.framework/flutter_assets" 【发布时间】:2020-07-23 10:41:29 【问题描述】:我正在尝试在模拟器 ( iPhone 8 ) 上运行我的颤振应用程序,但是当应用程序启动时,我得到的只是一个空白的白色屏幕。像这样:
终端输出是:
Running pod install... 40.0s
Running Xcode build...
├─Assembling Flutter resources... 20.4s
└─Compiling, linking and signing... 57.0s
Xcode build done. 288.8s
path: satisfied (Path is satisfied), interface: en1
Failed to find assets path for "Frameworks/App.framework/flutter_assets"
Configuring the default Firebase app...
path: satisfied (Path is satisfied), interface: en1
path: satisfied (Path is satisfied), interface: en1
Configured the default Firebase app __FIRAPP_DEFAULT.
[VERBOSE-2:engine.cc(127)] Engine run configuration was invalid.
[VERBOSE-2:shell.cc(437)] Could not launch engine with configuration.
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
Syncing files to device iPhone 8...
10,195ms (!)
我用的是flutter1.12.13+hotfix.9
的稳定版,这个问题只出现在ios构建上。
我该如何解决这个问题?
【问题讨论】:
【参考方案1】:在我的情况下,我需要在 Build Phrases -> Run Script 中取消选中“For install build only”的构建标志
【讨论】:
【参考方案2】:首先,你应该在你的 android studio 终端中写下这个命令:
rm -rf ios/Flutter/App.framework
然后在 Xcode 中选择 TARGETS 然后选择 Runner
然后从中间顶部选项中选择构建阶段
然后打开Thin Binary
删除里面的脚本
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" 嵌入
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" 瘦
这对我有用,希望对你也有用:-)
进一步阅读: https://flutter.dev/docs/development/ios-project-migration
【讨论】:
【参考方案3】:您可以按照https://flutter.dev/docs/development/ios-project-migration中的说明进行操作
尤其是构建阶段:
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
您可以在此处查看更多信息: https://github.com/flutter/flutter/issues/52084#issuecomment-600768772
【讨论】:
您好,在vscode项目根目录的终端下执行,谢谢【参考方案4】:我刚刚设法解决了这个问题。我刚刚遵循了https://github.com/flutter/flutter/issues/29974 的建议并添加了 “$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh”嵌入 运行脚本 Run script 重建后 App.framework 文件夹已添加到构建目录,问题已经消失。 希望这对其他人有帮助。
【讨论】:
朱莉娅,你的方法是最好的! 感谢您的成功!不知道为什么会发生这种情况以上是关于找不到“Frameworks/App.framework/flutter_assets”的资产路径的主要内容,如果未能解决你的问题,请参考以下文章