From a23fa923c290816b1be7d5f0470bd875f0ac37c8 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 19 Apr 2018 12:01:46 -0700 Subject: [PATCH] Look for an assets path specification in the Info.plist. (#5049) --- .../darwin/ios/framework/Source/FlutterDartProject.mm | 6 +++++- .../ios/framework/Source/FlutterDartProject_Internal.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 3c613c9fba..402d7dfd33 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -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; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 7fe1fc364f..155f3c8ef4 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -15,6 +15,8 @@ - (shell::RunConfiguration)runConfiguration; ++ (NSString*)flutterAssetsName:(NSBundle*)bundle; + @end #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ -- GitLab