-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pod Cannot Find Headers for Dynamic Dependency #8090
Comments
After doing more digging, it seems like this is even more than just an issue with my pod finding the header for the dependency framework. Even if I manually include the header, I then get Any help would definitely be appreciated |
Did you try 1.6.0.beta.1? |
Attempted the 1.6.0 beta 1 and the issue still happens. Posting another Stack
Installation Source
Plugins
Podfile# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end
target 'Runner' do
use_frameworks!
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}
# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end |
Hi, I've fixed my application adding this code to Podfile Maybe it's not what you are looking for but I hope it helps. |
@Errichamonda Thanks for that, but it's a bit different than what this issue is talking about. Our current issue is in regards to Swift projects with the |
Hello, any updates? |
Any news anyone? |
@Nightsd01 To your knowledge, is there any workaround we could use? Unfortunately, this is blocking me from integrating onesignal in my project. |
No updates / news, I don't think anyone has gotten the chance to look into this one yet. |
The complexity of the example Podfile makes it a bit difficult to narrow down what exactly is going on - if anyone has a more concise example that can reproduce the issue that would be helpful |
@andreamazz Does your project use any Swift? If it does not - I would recommend removing any occurrences of |
@Nightsd01 Assuming your last comment was meant for me, unfortunately my project uses Swift |
1.6.0 supports Swift static libraries (originally introduced in 1.5.3 I think) |
I upgraded to 1.6.0.beta.2, removed |
@Nightsd01 Using |
I forked the flutter onesignal plugin and got it to no longer give this conflict by renaming it also making it depend on |
@andreidiaconu Can you post your Podfile? |
|
So there are a few problems, you should declare each First, wherever Then, edit your Podfile to this: # Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end
target 'Runner' do
pod 'Firebase/Database'
pod 'ImagePalette'
pod 'Purchases', :modular_headers => true
pod 'Branch'
pod 'FacebookSDK'
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}
# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
end
target 'OneSignalNotificationServiceExtension' do
pod 'OneSignal', '>= 2.8.8', '< 3.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end |
@andreidiaconu Also, made a mistake so I've edited the podfile I posted in the previous comment. Please note that you should not be manually adding |
I suspected that each target needs to declare pod dependencies individually, but this does not make the error go away. It now sais |
@andreidiaconu Can you post the full error? |
I've done some more investigating of this issue and I believe it is being caused by how Cocoapods strips unused architectures from universal frameworks. I have posted a more detailed issue with Cocoapods here so I will be closing this issue: #8246 |
@Nightsd01 The error is just If it helps, here is the full output I see in xcode
|
That means that your Extension target is still trying to link to pods/frameworks it should not be using.... You are using exactly the Podfile I posted above right? Then you edited |
Yes. And I also do a project clean after these kind of changes. In Build
Settings, I can see that these dependencies are added because of
$(inherited)
…On Sat, Nov 3, 2018, 02:14 Brad Hesse ***@***.*** wrote:
That means that your Extension target is still trying to link to
pods/frameworks it should not be using....
You are using *exactly* the Podfile I posted above right? Then you edited
onesignal.podspec? And then ran pod install?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8090 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABVkvhjg42957QMg9o8Mx7LXdprRLwVoks5urN_KgaJpZM4WmX3Y>
.
|
@andreidiaconu where do you see |
@Nightsd01 If I go to my Note |
I have the same problem, any news? |
I have the same problem, any news? |
This Helped me 👍🏻 Delete pod files your iOS folder, execute the following commands
|
Report
What did you do?
We have a Flutter project that acts as a local (development) pod, the podspec for it is here. It depends on a dynamic framework (our native iOS SDK).
pod install
works fine, but when users attempt to build our pod, it cannot find the header file for our native iOS dynamic framework.The strange thing is: it works if the user isn't using
use_frameworks!
. But if the user's project does useuse_frameworks!
, this issue pops up.What did you expect to happen?
The pod to build correctly.
What happened instead?
Xcode cannot find the header files for our native SDK.
{User project} -> {Our local Flutter pod} -> {Our native SDK, a dynamic framework}
Our local flutter pod complains that it cannot find the header files of our native SDK
CocoaPods Environment
Stack
Installation Source
Plugins
Here is our podspec for our Flutter SDK, note that it depends on
OneSignalDynamic
which is our native dynamic framework:And here is the podspec for our native SDK (the above podspec depends on this one)
Project that demonstrates the issue
EXAMPLE PROJECT
It's a Flutter project, but you don't need Flutter to reproduce the issue. Just open the project in the
/ios
folder and attempt to build and you'll see the missing headers error.The text was updated successfully, but these errors were encountered: