GithubHelp home page GithubHelp logo

Comments (12)

kiplelive-zariman avatar kiplelive-zariman commented on August 18, 2024 3

Here the solution worked for me

  1. 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,
}
  1. remove
use_modular_headers!
  1. $static_framework should be declare same level with post_install, not inside project '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.

lijy91 avatar lijy91 commented on August 18, 2024 1

@amorenew Can you try to remove use_modular_headers! on the Podfile?

from flutter_flipperkit.

arcturus avatar arcturus commented on August 18, 2024

Got the same error in 1.17.3 (updated from 1.12.13+hotfix.9)

from flutter_flipperkit.

mikaoelitiana avatar mikaoelitiana commented on August 18, 2024

Did you find a solution for this?

from flutter_flipperkit.

obiwanzenobi avatar obiwanzenobi commented on August 18, 2024

Got the same error in 1.20.3

from flutter_flipperkit.

amorenew avatar amorenew commented on August 18, 2024

@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.

lijy91 avatar lijy91 commented on August 18, 2024

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.

amorenew avatar amorenew commented on August 18, 2024

@lijy91 I will try it

from flutter_flipperkit.

amorenew avatar amorenew commented on August 18, 2024

@lijy91 Adding Runner-Noop.swift didn't resolve my case
Screen Shot 2020-10-22 at 2 48 33 A

from flutter_flipperkit.

amorenew avatar amorenew commented on August 18, 2024

@lijy91 still not working, I wonder is my sample building on your machine?
https://github.com/amorenew/flutter-flavor-example

from flutter_flipperkit.

rzubascu avatar rzubascu commented on August 18, 2024

@amorenew I have the same issue when archiving the iOS app. Did you find any fix for this?

from flutter_flipperkit.

lijy91 avatar lijy91 commented on August 18, 2024

@rzubascu Please remove it in release mode.

from flutter_flipperkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.