Skip to content

Commit a8905f3

Browse files
committed
fix(example): explicitly configure CocoaPods for iOS example app
- Adds an explicit local path for the `permission_handler_apple` pod in the `Podfile` to ensure headers and modules are correctly installed in environments where the Flutter tool hasn't injected pods - Restores standard CocoaPods build phases to the Xcode project, including `[CP] Check Pods Manifest.lock`, `[CP] Embed Pods Frameworks`, and `[CP] Copy Pods Resources` - Links `libPods-Runner.a` and adds references to CocoaPods-generated configuration files (`.xcconfig`) for Debug, Release, and Profile configurations - Removes redundant IDE workspace metadata files from the `xcshareddata` directory
1 parent 3f844a0 commit a8905f3

4 files changed

Lines changed: 89 additions & 16 deletions

File tree

permission_handler/example/ios/Podfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ target 'Runner' do
3030
use_modular_headers!
3131

3232
# Pods for Runner
33+
# Explicitly include the permission_handler_apple plugin pod from the
34+
# Flutter-generated symlink. This ensures CocoaPods installs the plugin
35+
# headers/modules in CI/local environments where the Flutter tool doesn't
36+
# inject pods prior to `pod install` being run separately.
37+
begin
38+
pod 'permission_handler_apple', :path => File.join(__dir__, '.symlinks', 'plugins', 'permission_handler_apple', 'ios'), :modular_headers => true
39+
rescue => e
40+
# If the symlink/plugin isn't available (for example when building upstream
41+
# or when the plugin isn't included), fall back silently so the Podfile
42+
# remains compatible.
43+
puts "Warning: could not add local permission_handler_apple pod: #{e}"
44+
end
3345
# Keep this minimal: do not reference any test target such as `RunnerTests`.
3446

3547
# If CI needs Flutter-managed pods, the Flutter tool will regenerate a suitable

permission_handler/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +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+
674C8ACD8DF52F731598E1FF /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4828F04B8B22A9919411F8E9 /* libPods-Runner.a */; };
1213
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1314
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1415
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -32,18 +33,22 @@
3233
/* Begin PBXFileReference section */
3334
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3435
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
36+
34BFAFFA3D058B29987B131B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3537
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
38+
4828F04B8B22A9919411F8E9 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3639
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3740
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3841
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
3942
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4043
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
4144
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
45+
974B29137FCD93E52E367F5D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
4246
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
4347
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4448
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4549
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4650
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
51+
EE21984930FC70A887A80914 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
4752
F6BD02752B56D87600C59EAA /* RunnerDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerDebug.entitlements; sourceTree = "<group>"; };
4853
/* End PBXFileReference section */
4954

@@ -53,6 +58,7 @@
5358
buildActionMask = 2147483647;
5459
files = (
5560
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
61+
674C8ACD8DF52F731598E1FF /* libPods-Runner.a in Frameworks */,
5662
);
5763
runOnlyForDeploymentPostprocessing = 0;
5864
};
@@ -62,6 +68,9 @@
6268
2982F40ECD3DD26A4434B596 /* Pods */ = {
6369
isa = PBXGroup;
6470
children = (
71+
974B29137FCD93E52E367F5D /* Pods-Runner.debug.xcconfig */,
72+
34BFAFFA3D058B29987B131B /* Pods-Runner.release.xcconfig */,
73+
EE21984930FC70A887A80914 /* Pods-Runner.profile.xcconfig */,
6574
);
6675
path = Pods;
6776
sourceTree = "<group>";
@@ -85,6 +94,7 @@
8594
97C146F01CF9000F007C117D /* Runner */,
8695
97C146EF1CF9000F007C117D /* Products */,
8796
2982F40ECD3DD26A4434B596 /* Pods */,
97+
B1E859CE679AC50E2687FA15 /* Frameworks */,
8898
);
8999
sourceTree = "<group>";
90100
};
@@ -112,19 +122,30 @@
112122
path = Runner;
113123
sourceTree = "<group>";
114124
};
125+
B1E859CE679AC50E2687FA15 /* Frameworks */ = {
126+
isa = PBXGroup;
127+
children = (
128+
4828F04B8B22A9919411F8E9 /* libPods-Runner.a */,
129+
);
130+
name = Frameworks;
131+
sourceTree = "<group>";
132+
};
115133
/* End PBXGroup section */
116134

117135
/* Begin PBXNativeTarget section */
118136
97C146ED1CF9000F007C117D /* Runner */ = {
119137
isa = PBXNativeTarget;
120138
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
121139
buildPhases = (
140+
6109A77544E2A608152D8E56 /* [CP] Check Pods Manifest.lock */,
122141
9740EEB61CF901F6004384FC /* Run Script */,
123142
97C146EA1CF9000F007C117D /* Sources */,
124143
97C146EB1CF9000F007C117D /* Frameworks */,
125144
97C146EC1CF9000F007C117D /* Resources */,
126145
9705A1C41CF9048500538489 /* Embed Frameworks */,
127146
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
147+
1CB340E0CE8D0AAF26418967 /* [CP] Embed Pods Frameworks */,
148+
B8799AB9DF5B9EDFFFDECCAB /* [CP] Copy Pods Resources */,
128149
);
129150
buildRules = (
130151
);
@@ -189,6 +210,23 @@
189210
/* End PBXResourcesBuildPhase section */
190211

191212
/* Begin PBXShellScriptBuildPhase section */
213+
1CB340E0CE8D0AAF26418967 /* [CP] Embed Pods Frameworks */ = {
214+
isa = PBXShellScriptBuildPhase;
215+
buildActionMask = 2147483647;
216+
files = (
217+
);
218+
inputFileListPaths = (
219+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
220+
);
221+
name = "[CP] Embed Pods Frameworks";
222+
outputFileListPaths = (
223+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
224+
);
225+
runOnlyForDeploymentPostprocessing = 0;
226+
shellPath = /bin/sh;
227+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
228+
showEnvVarsInLog = 0;
229+
};
192230
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
193231
isa = PBXShellScriptBuildPhase;
194232
alwaysOutOfDate = 1;
@@ -205,6 +243,28 @@
205243
shellPath = /bin/sh;
206244
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
207245
};
246+
6109A77544E2A608152D8E56 /* [CP] Check Pods Manifest.lock */ = {
247+
isa = PBXShellScriptBuildPhase;
248+
buildActionMask = 2147483647;
249+
files = (
250+
);
251+
inputFileListPaths = (
252+
);
253+
inputPaths = (
254+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
255+
"${PODS_ROOT}/Manifest.lock",
256+
);
257+
name = "[CP] Check Pods Manifest.lock";
258+
outputFileListPaths = (
259+
);
260+
outputPaths = (
261+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
262+
);
263+
runOnlyForDeploymentPostprocessing = 0;
264+
shellPath = /bin/sh;
265+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
266+
showEnvVarsInLog = 0;
267+
};
208268
9740EEB61CF901F6004384FC /* Run Script */ = {
209269
isa = PBXShellScriptBuildPhase;
210270
alwaysOutOfDate = 1;
@@ -220,6 +280,23 @@
220280
shellPath = /bin/sh;
221281
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
222282
};
283+
B8799AB9DF5B9EDFFFDECCAB /* [CP] Copy Pods Resources */ = {
284+
isa = PBXShellScriptBuildPhase;
285+
buildActionMask = 2147483647;
286+
files = (
287+
);
288+
inputFileListPaths = (
289+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
290+
);
291+
name = "[CP] Copy Pods Resources";
292+
outputFileListPaths = (
293+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
294+
);
295+
runOnlyForDeploymentPostprocessing = 0;
296+
shellPath = /bin/sh;
297+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
298+
showEnvVarsInLog = 0;
299+
};
223300
/* End PBXShellScriptBuildPhase section */
224301

225302
/* Begin PBXSourcesBuildPhase section */

permission_handler/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

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

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

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

0 commit comments

Comments
 (0)