hyperledger / aries-askar

Secure storage designed for Hyperledger Aries agents.
Apache License 2.0
58 stars 44 forks source link

React Native Wrapper: problem with `use_frameworks!` #187

Closed niall-shaw closed 9 months ago

niall-shaw commented 11 months ago

use_frameworks! in ios/Podfile causes buildtime errors with aries-askar pod:

'ariesAskar.h' file not found with <angled> include, use "quotes" instead

We need use_frameworks! for other dependencies

jamshale commented 10 months ago

I agree this is a problem. I got around it by using an older version of the dependency I needed to use. Which obviously isn't ideal. This should be looked at.

niall-shaw commented 10 months ago

@jamshale - posting here because it may be of help to you. I was able to mitigate the problem above by adding the following to my Podfile:

pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name&.eql?('aries-askar')|| pod.name&.eql?('indy-vdr')
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
  end
...
  post_install do |installer|
    ...

    installer.pods_project.targets.each do |target|
      ...
      if (target.name&.eql?("aries-askar") || target.name&.eql?("indy-vdr"))
        target.build_configurations.each do |config|
          config.build_settings["HEADER_SEARCH_PATHS"] = "$(inherited) ${PODS_ROOT}/Headers/Public/**"
          config.build_settings["MACH_O_TYPE"] = "staticlib"
        end
      end

This is necessary for both aries-askar and indy-vdr. I was having some trouble debugging the app with the static libraries, but I haven't had enough capacity to investigate this further.

Hope this helps someone.

TimoGlastra commented 10 months ago

IS this something we can add to the podspecs for these libraries so it works out of the box?

niall-shaw commented 10 months ago

Good question, I'll investigate.

berendsliedrecht commented 10 months ago

It is a specific compiler issue. Angled brackets are "reserved" for system dependencies and quotes for local dependencies. I think we can just change the < and > to quotes and it should be fine.