Skip to content

Commit f9668c0

Browse files
committed
Fix iOS build
1 parent d49b7d1 commit f9668c0

File tree

6 files changed

+26
-107
lines changed

6 files changed

+26
-107
lines changed

.github/workflows/google_api_availability.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ on:
1212

1313
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1414
jobs:
15-
# Job configuration for the geolocator (App Facing Package)
16-
geolocator:
15+
# Job configuration for the google_api_availability (App Facing Package)
16+
google_api_availability:
1717
# The type of runner that the job will run on
1818
runs-on: macos-latest
1919
env:
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
channel: 'beta'
3232

33-
# Download all Flutter packages the geolocator depends on
33+
# Download all Flutter packages the google_api_availability depends on
3434
- name: Download dependencies
3535
run: flutter pub get
3636
working-directory: ${{env.source-directory}}
@@ -54,4 +54,3 @@ jobs:
5454
- name: Run iOS build
5555
run: flutter build ios --release --no-codesign
5656
working-directory: ${{env.example-directory}}
57-

example/ios/Podfile

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,60 +10,29 @@ project 'Runner', {
1010
'Release' => :release,
1111
}
1212

13-
def parse_KV_file(file, separator='=')
14-
file_abs_path = File.expand_path(file)
15-
if !File.exists? file_abs_path
16-
return [];
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
1717
end
18-
pods_ary = []
19-
skip_line_start_symbols = ["#", "/"]
20-
File.foreach(file_abs_path) { |line|
21-
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22-
plugin = line.split(pattern=separator)
23-
if plugin.length == 2
24-
podname = plugin[0].strip()
25-
path = plugin[1].strip()
26-
podpath = File.expand_path("#{path}", file_abs_path)
27-
pods_ary.push({:name => podname, :path => podpath});
28-
else
29-
puts "Invalid plugin specification: #{line}"
30-
end
31-
}
32-
return pods_ary
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
3324
end
3425

35-
target 'Runner' do
36-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
37-
# referring to absolute paths on developers' machines.
38-
system('rm -rf .symlinks')
39-
system('mkdir -p .symlinks/plugins')
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
4027

41-
# Flutter Pods
42-
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
43-
if generated_xcode_build_settings.empty?
44-
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
45-
end
46-
generated_xcode_build_settings.map { |p|
47-
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
48-
symlink = File.join('.symlinks', 'flutter')
49-
File.symlink(File.dirname(p[:path]), symlink)
50-
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
51-
end
52-
}
28+
flutter_ios_podfile_setup
5329

54-
# Plugin Pods
55-
plugin_pods = parse_KV_file('../.flutter-plugins')
56-
plugin_pods.map { |p|
57-
symlink = File.join('.symlinks', 'plugins', p[:name])
58-
File.symlink(p[:path], symlink)
59-
pod p[:name], :path => File.join(symlink, 'ios')
60-
}
30+
target 'Runner' do
31+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
6132
end
6233

6334
post_install do |installer|
6435
installer.pods_project.targets.each do |target|
65-
target.build_configurations.each do |config|
66-
config.build_settings['ENABLE_BITCODE'] = 'NO'
67-
end
36+
flutter_additional_ios_build_settings(target)
6837
end
6938
end

example/ios/Podfile.lock

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
PODS:
2-
- Flutter (1.22.4)
3-
- google_api_availability (2.0.4):
4-
- Flutter
2+
- Flutter (1.0.0)
53

64
DEPENDENCIES:
7-
- google_api_availability (from `.symlinks/plugins/google_api_availability/ios`)
8-
9-
SPEC REPOS:
10-
trunk:
11-
- Flutter
5+
- Flutter (from `Flutter`)
126

137
EXTERNAL SOURCES:
14-
google_api_availability:
15-
:path: ".symlinks/plugins/google_api_availability/ios"
8+
Flutter:
9+
:path: Flutter
1610

1711
SPEC CHECKSUMS:
18-
Flutter: d466195df8a9933b705cb82c53140202e097ec55
19-
google_api_availability: 15fa42a8cd83c0a6738507ffe6e87096f12abcb8
12+
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
2013

21-
PODFILE CHECKSUM: aff02bfeed411c636180d6812254b2daeea14d09
14+
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
2215

2316
COCOAPODS: 1.10.1

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1412
625D9F92BEBF2969BD65187A /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A0A02CAE646E57E01E66F3 /* libPods-Runner.a */; };
15-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1713
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
1814
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1915
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
@@ -29,8 +25,6 @@
2925
dstPath = "";
3026
dstSubfolderSpec = 10;
3127
files = (
32-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
33-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
3428
);
3529
name = "Embed Frameworks";
3630
runOnlyForDeploymentPostprocessing = 0;
@@ -41,14 +35,12 @@
4135
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
4236
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4337
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
44-
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
4538
4187BAA3D872835C9A75A66C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
4639
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4740
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4841
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
4942
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5043
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
51-
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
5244
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
5345
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
5446
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -65,8 +57,6 @@
6557
isa = PBXFrameworksBuildPhase;
6658
buildActionMask = 2147483647;
6759
files = (
68-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
69-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
7060
625D9F92BEBF2969BD65187A /* libPods-Runner.a in Frameworks */,
7161
);
7262
runOnlyForDeploymentPostprocessing = 0;
@@ -85,9 +75,7 @@
8575
9740EEB11CF90186004384FC /* Flutter */ = {
8676
isa = PBXGroup;
8777
children = (
88-
3B80C3931E831B6300D905FE /* App.framework */,
8978
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
90-
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9179
9740EEB21CF90195004384FC /* Debug.xcconfig */,
9280
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9381
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -162,7 +150,6 @@
162150
97C146EC1CF9000F007C117D /* Resources */,
163151
9705A1C41CF9048500538489 /* Embed Frameworks */,
164152
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
165-
A720263B4F21833AAA47A59C /* [CP] Embed Pods Frameworks */,
166153
);
167154
buildRules = (
168155
);
@@ -233,7 +220,7 @@
233220
);
234221
runOnlyForDeploymentPostprocessing = 0;
235222
shellPath = /bin/sh;
236-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
223+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
237224
};
238225
8C45BC3DC5D1824DB23EE851 /* [CP] Check Pods Manifest.lock */ = {
239226
isa = PBXShellScriptBuildPhase;
@@ -271,24 +258,6 @@
271258
shellPath = /bin/sh;
272259
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
273260
};
274-
A720263B4F21833AAA47A59C /* [CP] Embed Pods Frameworks */ = {
275-
isa = PBXShellScriptBuildPhase;
276-
buildActionMask = 2147483647;
277-
files = (
278-
);
279-
inputPaths = (
280-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
281-
"${PODS_ROOT}/Flutter/Flutter.framework",
282-
);
283-
name = "[CP] Embed Pods Frameworks";
284-
outputPaths = (
285-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
286-
);
287-
runOnlyForDeploymentPostprocessing = 0;
288-
shellPath = /bin/sh;
289-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
290-
showEnvVarsInLog = 0;
291-
};
292261
/* End PBXShellScriptBuildPhase section */
293262

294263
/* Begin PBXSourcesBuildPhase section */
@@ -326,7 +295,6 @@
326295
/* Begin XCBuildConfiguration section */
327296
249021D3217E4FDB00AE95B9 /* Profile */ = {
328297
isa = XCBuildConfiguration;
329-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
330298
buildSettings = {
331299
ALWAYS_SEARCH_USER_PATHS = NO;
332300
CLANG_ANALYZER_NONNULL = YES;
@@ -398,7 +366,6 @@
398366
};
399367
97C147031CF9000F007C117D /* Debug */ = {
400368
isa = XCBuildConfiguration;
401-
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
402369
buildSettings = {
403370
ALWAYS_SEARCH_USER_PATHS = NO;
404371
CLANG_ANALYZER_NONNULL = YES;
@@ -452,7 +419,6 @@
452419
};
453420
97C147041CF9000F007C117D /* Release */ = {
454421
isa = XCBuildConfiguration;
455-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
456422
buildSettings = {
457423
ALWAYS_SEARCH_USER_PATHS = NO;
458424
CLANG_ANALYZER_NONNULL = YES;

example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)