Comments (12)
Here the solution worked for me
- declare all flavour on this section
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
# Declare all flavaor/variant here
'Debug-Development' => :debug,
'Release-Development' => :release,
'Release-Staging' => :release,
'Release-Production' => :release,
}
- remove
use_modular_headers!
$static_framework
should be declare same level withpost_install
, not insideproject 'Runner'
$static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
post_install do |installer|
Finally the Podfile should look like 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'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
# Declare all flavaor/variant here
'Debug-Development' => :debug,
'Release-Development' => :release,
'Release-Staging' => :release,
'Release-Production' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
# use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
# If you use `use_frameworks!` in your Podfile,
# uncomment the below $static_framework array and also
# the pre_install section. This will cause Flipper and
# it's dependencies to be built as a static library and all other pods to
# be dynamic.s
$static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
file_name = Dir.glob("*.xcodeproj")[0]
app_project = Xcodeproj::Project.open(file_name)
app_project.native_targets.each do |target|
target.build_configurations.each do |config|
cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
cflags << '-DFB_SONARKIT_ENABLED=1'
end
config.build_settings['OTHER_CFLAGS'] = cflags
end
app_project.save
end
installer.pods_project.save
end
from flutter_flipperkit.
@amorenew Can you try to remove use_modular_headers!
on the Podfile?
from flutter_flipperkit.
Got the same error in 1.17.3 (updated from 1.12.13+hotfix.9)
from flutter_flipperkit.
Did you find a solution for this?
from flutter_flipperkit.
Got the same error in 1.20.3
from flutter_flipperkit.
@lijy91 I wonder if you could check what is wrong with multi schemes?
I got it in a Flavored project "Multi Schemes- White label"
Sample of the multi scheme project:
https://github.com/amorenew/flutter-flavor-example
Error:
Undefined symbols for architecture x86_64:
"CKAnalyticsListenerHelpers::GetReusedNodes(NSObject*)", referenced from:
+[SKComponentLayoutWrapper newFromRoot:parentKey:] in libFlipperKit.a(SKComponentLayoutWrapper.o)
ld: symbol(s) not found for architecture x86_64
from flutter_flipperkit.
You can try this step
Open ios/Runner.xcworkspace Add a empty Swift file (e.g Runner-Noop.swift) into Runner Group And make sure the Runner-Bridging-Header.h file is created.
from flutter_flipperkit.
@lijy91 I will try it
from flutter_flipperkit.
@lijy91 Adding Runner-Noop.swift didn't resolve my case
from flutter_flipperkit.
@lijy91 still not working, I wonder is my sample building on your machine?
https://github.com/amorenew/flutter-flavor-example
from flutter_flipperkit.
@amorenew I have the same issue when archiving the iOS app. Did you find any fix for this?
from flutter_flipperkit.
@rzubascu Please remove it in release mode.
from flutter_flipperkit.
Related Issues (20)
- How to set up with new style settings.gradle file on Android? HOT 1
- New pod format support HOT 2
- [Flutter v1.22] Cannot build HOT 2
- Error building iOS app after Flutter (1.22.1) upgrade HOT 13
- Plugins seem to not be working on flipper 0.72.0 HOT 3
- Not able to Build iOS default flutter app HOT 2
- Upgrade to uuid ^3.0.1 HOT 1
- Not working with --profile flag HOT 4
- fatal error: 'boost/preprocessor/control/expr_iif.hpp' file not found HOT 1
- Watchman: Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions HOT 2
- iOS error when building as static library HOT 8
- symbol(s) not found for architecture x86_64 HOT 1
- Can't build Android with Gradle Build Tools 4.2.1 HOT 3
- Conflict with other dependencies HOT 2
- HttpClient的签名发生了改变 HOT 1
- ios 启动报错 HOT 3
- How to mock network in flutter using flipper
- Project run throws " The non-abstract class 'FlipperHttpClient' is missing implementations " HOT 2
- Use of bitwise '|' with boolean operands | XCode 14.3 fails builds using Yoga, If there is a need to use an old version Yoga, an older version of XCode is required.
- CKNonNull.h:47:33 No member named 'move' in namespace 'std'; did you mean 'modf'?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_flipperkit.