Skip to content

Commit db4656e

Browse files
committed
fix: add workaround regarding xcprivacy issue with Bugsee
1 parent fcd437c commit db4656e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/app/ios/Podfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,26 @@ post_install do |installer|
4646
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
4747
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
4848
end
49+
50+
# Workaround: move .xcprivacy files from Sources to Resources build phase.
51+
# Some pods (e.g. bugsee_flutter) incorrectly place PrivacyInfo.xcprivacy in
52+
# the Sources phase, causing "no rule to process file ... of type 'text.xml'"
53+
# during xcodebuild archive.
54+
sources_phase = target.build_phases.find { |p| p.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase) }
55+
next unless sources_phase
56+
57+
xcprivacy_files = sources_phase.files.select { |f| f.file_ref&.path&.end_with?('.xcprivacy') }
58+
next if xcprivacy_files.empty?
59+
60+
resources_phase = target.build_phases.find { |p| p.is_a?(Xcodeproj::Project::Object::PBXResourcesBuildPhase) }
61+
resources_phase ||= target.new_resources_build_phase
62+
63+
xcprivacy_files.each do |build_file|
64+
file_ref = build_file.file_ref
65+
sources_phase.remove_file_reference(file_ref)
66+
unless resources_phase.files.map(&:file_ref).include?(file_ref)
67+
resources_phase.add_file_reference(file_ref)
68+
end
69+
end
4970
end
5071
end

src/cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Prefix your items with `(Template)` if the change is about the template and not
88
## 0.26.2
99
- Fix issue with dispose in VM.
1010
- Fix errors in documentation.
11+
- Fix issue with Bugsee and xcprivacy files
1112

1213
## 0.26.1
1314
- Update flutter to 3.38.5 and update dependencies.

0 commit comments

Comments
 (0)