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

This commit is contained in:
Chinmay Garde
2018-04-19 12:01:46 -07:00
committed by GitHub
parent 656482af41
commit 4aa708019e
2 changed files with 7 additions and 1 deletions

View File

@@ -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;

View File

@@ -15,6 +15,8 @@
- (shell::RunConfiguration)runConfiguration;
+ (NSString*)flutterAssetsName:(NSBundle*)bundle;
@end
#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_