Open scottholdren opened 3 years ago
+1 for breaking our iOS builds.
@scottholdren do you mind clarifying where you added this? I tried adding at the bottom of /ios/App/Podfile by got an error when running ionic cap sync
:
[!] CocoaPods could not find compatible versions for pod "Branch":
In Podfile:
Branch (= 1.38.0)
Edit: I did the following below and unfortunately still got the build error ld: framework not found AdServices
pod 'Branch', '1.38.0'
in the target 'App' do
section of /ios/App/Podfile
pod install --repo-update
I am appending it to /ios/App/Podfile, followed by some stuff to fix bitcode errors.
I am running
pod repo update
ionic capacitor add ios
cat build_resources/Podfile.extras >> ios/App/Podfile
in that order every time.
build_resources/Podfile.extras
pod 'Branch', '1.38.0'
def disable_bitcode_for_target(target)
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
remove_cflags_matching(config.build_settings, ['-fembed-bitcode', '-fembed-bitcode-marker'])
end
end
def remove_cflags_matching(build_settings, cflags)
existing_cflags = build_settings['OTHER_CFLAGS']
removed_cflags = []
if !existing_cflags.nil?
cflags.each do |cflag|
existing_cflags.delete_if { |existing_cflag| existing_cflag == cflag && removed_cflags << cflag }
end
end
if removed_cflags.length > 0
build_settings['OTHER_CFLAGS'] = existing_cflags
end
end
post_install do |installer|
project_name = Dir.glob("*.xcodeproj").first
project = Xcodeproj::Project.open(project_name)
project.targets.each do |target|
disable_bitcode_for_target(target)
end
project.save
installer.pods_project.targets.each do |target|
disable_bitcode_for_target(target)
end
installer.pods_project.save
end
I am appending it to /ios/App/Podfile, followed by some stuff to fix bitcode errors.
I am running
pod repo update
ionic capacitor add ios
cat build_resources/Podfile.extras >> ios/App/Podfile
in that order every time.
build_resources/Podfile.extras
pod 'Branch', '1.38.0' def disable_bitcode_for_target(target) target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' remove_cflags_matching(config.build_settings, ['-fembed-bitcode', '-fembed-bitcode-marker']) end end def remove_cflags_matching(build_settings, cflags) existing_cflags = build_settings['OTHER_CFLAGS'] removed_cflags = [] if !existing_cflags.nil? cflags.each do |cflag| existing_cflags.delete_if { |existing_cflag| existing_cflag == cflag && removed_cflags << cflag } end end if removed_cflags.length > 0 build_settings['OTHER_CFLAGS'] = existing_cflags end end post_install do |installer| project_name = Dir.glob("*.xcodeproj").first project = Xcodeproj::Project.open(project_name) project.targets.each do |target| disable_bitcode_for_target(target) end project.save installer.pods_project.targets.each do |target| disable_bitcode_for_target(target) end installer.pods_project.save end
Thank you, I'll give this a shot!
Having the same issue still.
same issue. has anyone got this working withpod 'Branch', '1.39.4'
?
A recent update to the SDK has removed the AdServices import, which is breaking iOS builds. Manually setting
pod 'Branch', '1.38.0'
has fixed it for now.