未验证 提交 a23fa923 编写于 作者: C Chinmay Garde 提交者: GitHub

Look for an assets path specification in the Info.plist. (#5049)

上级 3405e23a
......@@ -70,7 +70,11 @@ static blink::Settings DefaultSettingsForProcess() {
// Checks to see if the flutter assets directory is already present.
if (settings.assets_path.size() == 0) {
NSString* assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:@""];
// The kernel assets will not be present in the Flutter frameworks bundle since it is not user
// editable. Instead, look inside the main bundle.
NSBundle* bundle = [NSBundle mainBundle];
NSString* assets_directory_name = [FlutterDartProject flutterAssetsName:bundle];
NSString* assetsPath = [bundle pathForResource:assets_directory_name ofType:@""];
if (assetsPath.length > 0) {
settings.assets_path = assetsPath.UTF8String;
......
......@@ -15,6 +15,8 @@
- (shell::RunConfiguration)runConfiguration;
+ (NSString*)flutterAssetsName:(NSBundle*)bundle;
@end
#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册