Onesignal-flutter-sdk: ld: framework not found FirebaseCore

Created on 5 Nov 2019  Â·  14Comments  Â·  Source: OneSignal/OneSignal-Flutter-SDK

Hi there

I have an error when try to execute my app in iOS phone or simulator.

I followed the instructions with the page (https://documentation.onesignal.com/docs/flutter-sdk-setup). But the error persists.

image

image

image

Also, I clean, build, set the commands pod Install, Pod deintegrate, delete Pod folder, PodFile.lockfile, delete files in ~/Library/Developer/Xcode/DerivedData, delete Target OneSignalNotificationServiceExtension and create it again. But the error continues.

I'm using the package onesignal_flutter: ^2.2.0

Thanks

Help Wanted

Most helpful comment

Hi @GadepalliAditya1998, I did made the steps that you recommended:

  • Select the OneSignalNotificationExtensions

Captura de Pantalla 2019-11-06 a la(s) 7 25 11 a  m

  • Added the FirebaseCore Library

Captura de Pantalla 2019-11-06 a la(s) 7 25 18 a  m

  • Clean and Build from XCode, but the error persists

All 14 comments

@FabianVarela The OneSignalNotificationServiceExtension target should only have OneSignal as a dependency, make sure you don't have any other pods in your Podfile for this target.

Hi @jkasten2 actually this is my PodFile

I need set use_frameworks! in OneSignalNotificationServiceExtension target, because appears this error

Runner (true) and OneSignalNotificationServiceExtension (false) do not both set use_frameworks!

````ruby

Uncomment this line to define a global platform for your project

platform :ios, '10.0'

CocoaPods analytics sends network stats synchronously affecting flutter build latency.

ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

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

pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

target 'OneSignalNotificationServiceExtension' do
use_frameworks!
pod 'OneSignal', '>= 2.9.5', '< 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
```

Even I faced the issue, but i resolved it. I am still not sure is this the right way to do it or not. But i will share you the solution which i have done by looking into stackoverflow.

Open your project (ios directory) in xcode.

Navigate to One signal extension and in that General Tab.

Search for Linked Frameworks and add the Firebase Core Framework by tapping on the + icon and try to build it (if your project is using Firebase core.).

Hi @GadepalliAditya1998, I did made the steps that you recommended:

  • Select the OneSignalNotificationExtensions

Captura de Pantalla 2019-11-06 a la(s) 7 25 11 a  m

  • Added the FirebaseCore Library

Captura de Pantalla 2019-11-06 a la(s) 7 25 18 a  m

  • Clean and Build from XCode, but the error persists

@FabianVarela Texted on facebook can you just reply there?

@GadepalliAditya1998 what's the Facebook message URL?

Perhaps changing the Embed setting would do the trick?

@rgomezp can you help me where I change the embed setting, what are the steps? Thanks

@FabianVarela ,
Next to the framework, the current setting is "Do Not Embed". Try toggling that

Take a look at my response here

Closing due to no response

Hi @rgomezp the solution that one signal support did give to me is with this link:
https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/42#issuecomment-459476383

Moreover, I had to change my project from objective C to swift, add or link all the packages to OneSignalNotificationExtensions

And the error has gone

Thanks

Can I recommend, update the documentation in OneSignal Flutter SDK or create a troubleshotting?

Thanks

Was this page helpful?
0 / 5 - 0 ratings