Skip to content
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

XCode 12 & RN 0.63 Issues & Fixes #30

Open
milos1290 opened this issue Nov 3, 2020 · 7 comments
Open

XCode 12 & RN 0.63 Issues & Fixes #30

milos1290 opened this issue Nov 3, 2020 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@milos1290
Copy link
Contributor

milos1290 commented Nov 3, 2020

Make sure you are using SDK version 1.1.1
Due to change in linking of Pod libraries in iOS to static linking, we have to change how Leanplum-iOS-SDK is linked by adding script in ios/Podfile which will switch Leanplum-iOS-SDK to dynamic linking.

dynamic_frameworks = ['Leanplum-iOS-SDK']
pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  installer.pod_targets.each do |pod|
      if dynamic_frameworks.include?(pod.name)
        puts "Setting dynamic linking for #{pod.name}"
        def pod.build_type;
          Pod::BuildType.dynamic_framework
        end
      end
    end
end

After adding the script, make sure you run pod install in ios/ folder
In case you are seeing swift unreferenced symbols, add any kind of Swift file to your main iOS app project in XCode, to force it to link against Swift libraries.

@milos1290 milos1290 added the documentation Improvements or additions to documentation label Nov 3, 2020
@milos1290 milos1290 pinned this issue Nov 3, 2020
@haelsisy
Copy link

@milos1290 With which build system?

@jgalianoz
Copy link

@milos1290 You can share an example of you Podfile, please 🙏

@milos1290
Copy link
Contributor Author

@jgalianoz here is a clean project with Leanplum RN SDK already setup
LPSample.zip

@jgalianoz
Copy link

jgalianoz commented Dec 9, 2020

I don't sure if this solution will resolve my problem actually my react-native version is 0.59.9
cc @milos1290

@jgalianoz
Copy link

jgalianoz commented Dec 9, 2020

I am adding this code but y receive this errors: cc @milos1290

dynamic_frameworks = ['Leanplum-iOS-SDK']
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if dynamic_frameworks.include?(pod.name)
      puts "Overriding the dynamic_framework? method for #{pod.name}"
      def pod.dynamic_framework?;
        true
      end
    end
  end
end

image

@nericode
Copy link

nericode commented Dec 29, 2020

Same problem attached image
Captura de Pantalla 2020-12-29 a la(s) 15 44 29

@aynofal
Copy link

aynofal commented Jan 22, 2021

Just a quick note, if your version of cocoapods is less than 1.9.0, the syntax is a bit different
with that said, here's the fix:

dynamic_frameworks = ['Leanplum-iOS-SDK']
pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  installer.pod_targets.each do |pod|
      if dynamic_frameworks.include?(pod.name)
        puts "Setting dynamic linking for #{pod.name}"
        def pod.build_type;
          # Cocoapods < 1.9.0
          Pod::Target::BuildType.dynamic_framework
          # Cocoapods >= 1.9.0
          # Pod::BuildType.dynamic_framework
        end
      end
    end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants