Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Load iOS dart bundle by URL fallback #22997

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
if (bundle == nil) {
bundle = [NSBundle bundleWithIdentifier:[FlutterDartProject defaultBundleIdentifier]];
}
if (bundle == nil) {
// The bundle isn't loaded and can't be found by bundle ID. Find it by path.
bundle = [NSBundle bundleWithURL:[NSBundle.mainBundle.privateFrameworksURL
URLByAppendingPathComponent:@"App.framework"]];
}
if (bundle == nil) {
bundle = mainBundle;
}
Expand Down Expand Up @@ -239,11 +244,16 @@ + (NSString*)flutterAssetsName:(NSBundle*)bundle {
bundle = [NSBundle bundleWithIdentifier:[FlutterDartProject defaultBundleIdentifier]];
}
if (bundle == nil) {
bundle = [NSBundle mainBundle];
// The bundle isn't loaded and can't be found by bundle ID. Find it by path.
bundle = [NSBundle bundleWithURL:[NSBundle.mainBundle.privateFrameworksURL
URLByAppendingPathComponent:@"App.framework"]];
}
NSString* flutterAssetsName = [bundle objectForInfoDictionaryKey:@"FLTAssetsPath"];
if (flutterAssetsName == nil) {
if (bundle == nil) {
bundle = [NSBundle mainBundle];
flutterAssetsName = @"Frameworks/App.framework/flutter_assets";
} else if (flutterAssetsName == nil) {
flutterAssetsName = @"flutter_assets";
}
return flutterAssetsName;
}
Expand Down