In my Flutter app I have a Podfile in which there are two extensions:
// Rest of the Podfile
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
target 'Extension' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
However I receive the following error:
Failed to build iOS app Could not build the precompiled application for the device. Swift Compiler Error (Xcode): 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead. /.pub-cache/hosted/pub.dev/add_2_calendar-3.0.1/ios/Classes/Add2CalendarPlugin.swift:12:35
Just to test it out, I have tried to remove that package from the pubspec.yaml file, but this problem happens with many other packages. How can I make it so that specifics packages will be installed in the Runner target, but not in the Extension target?