React native warpper and Podfile

Created by Qiang Zheng, Modified on Mon, 15 Aug, 2022 at 10:30 AM by Qiang Zheng

There are few partners who use React Native and failed to build the project, with the errors like "Library not loaded: @rpath/VirgilCrypto.framework/VirgilCrypto"


In normal project, you would need to  put use_frameworks! at top of your Podfile, but it is less likely you can do that with React Native project, you can try some workarounds to make that happen, e.g: https://medium.com/@joncardasis/swift-dynamic-frameworks-react-native-3d77c4972f32


We have some partners use a ruby gem build just the ClaySDK as a ‘dynamic framework’ type, but it is not applicable for M1 machine anymore, there a pre-install script that does the same job, without the need of the before mentioned gem:

  dynamic_frameworks = ['VirgilCryptoFoundation', 'VSCCrypto', 'VirgilCrypto', 'VirgilSDK', 'ClaySDK']
  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if dynamic_frameworks.include?(pod.name)
        puts "Overriding the build_type to dynamic_framework for #{pod.name}"
        def pod.build_type;
          Pod::BuildType.dynamic_framework
        end
      end
    end
  end


But once again, we do not have the React native knowledge in the house, so we are not able to support that, but just aligning knowledge from partners who have that.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article