From f74596d2b31e53568b67492cba3b334d95e60e05 Mon Sep 17 00:00:00 2001 From: Rafael Ring Date: Mon, 24 Sep 2018 13:26:43 -0300 Subject: [PATCH] =?UTF-8?q?Change=20FlutterDartProject=20to=20keep=20prece?= =?UTF-8?q?dence=20when=20looking=20for=20the=20ass=E2=80=A6=20(flutter/en?= =?UTF-8?q?gine#6305)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change FlutterDartProject to keep precedence when looking for the assets bundle * Change assetsPath to fallback to mainBundle when the defined bundle does not contain assets --- .../darwin/ios/framework/Source/FlutterDartProject.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index b1b50ef002..22d39950d9 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -96,7 +96,11 @@ static blink::Settings DefaultSettingsForProcess(NSBundle* bundle = nil) { // Checks to see if the flutter assets directory is already present. if (settings.assets_path.size() == 0) { NSString* assetsName = [FlutterDartProject flutterAssetsName:bundle]; - NSString* assetsPath = [mainBundle pathForResource:assetsName ofType:@""]; + NSString* assetsPath = [bundle pathForResource:assetsName ofType:@""]; + + if (assetsPath.length == 0) { + assetsPath = [mainBundle pathForResource:assetsName ofType:@""]; + } if (assetsPath.length == 0) { NSLog(@"Failed to find assets path for \"%@\"", assetsName);