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

OpenSSL.framework not found in PackagesFrameworks directory #35

Open
priska96 opened this issue Oct 9, 2024 · 3 comments
Open

OpenSSL.framework not found in PackagesFrameworks directory #35

priska96 opened this issue Oct 9, 2024 · 3 comments

Comments

@priska96
Copy link

priska96 commented Oct 9, 2024

While developing an expo module to read the PD file from the eGK via NFC and your OpenHealthCardKit I ran into the following issue:

Some context and folder structure:
I am building this module so I can later install it in my expo app and it works just fine with my config plugin and everything.
A thing that needs to be optimized however is the dependencies to the gematik OpenHealthCardKit.

/gk-nfc-reader
- ios/
-- OpenSSL.framework
-- GKNFCReader.swift
-- GKNFCReeader.h
-- all the other files for my native code
- node_modules/
- plugin/
-- src/
---index.ts //this is my expo config plugin
- Resources/ // this folder keeps my localization files for my native siwft module
- src/ // my folder for integrating my native module in RN
-- index.ts
--RNGKNFCReader.ts
-- useReadPersonalData.ts
- app.plugin.js // entry point for the expo config plugin
- -gk-nfc-reader.podspec
- package.json
- other package realtes files

So far I handled the dependencies manually and added the frameworks (HealthCardAccess.framework, NFCCardReaderProvider.framework, etc.) to my module ios folder and referenced them in my .podspec like so:

s.vendored_frameworks = 'ios/*.framework' #include all frameworks from gematik

That was due to the fact that your frameworks can only be added via SPM and there was no way to add an spm_dependency to a .podspec so far. I need the podspec since I am building a react native npm package.

A week ago react native added spm_dependency for the podspec. Which is great because now I can reference your frameworks like so:

spm_dependency(s,  
     url: "https://github.com/gematik/ref-OpenHealthCardKit", 
     requirement: {kind: "upToNextMajorVersion", minimumVersion: "5.6.0"}, 
     products: ["CardReaderProviderApi", "HealthCardAccess", "HealthCardControl", "Helper", "NFCCardReaderProvider"] 
   ) #include gemtaik frameworks via spm

However, I run into this error with OpenSSL.framework. I am not very familiar with xcode and the build process.

Library not loaded: @rpath/OpenSSL.framework/OpenSSL
Referenced from: <E7AC0210-177A-3DE1-8B7F-6A635A0B947E> /Users/USER/Library/Developer/CoreSimulator/Devices/7BBBC3E6-9E19-4FCB-8A20-32C0CF08D840/data/Containers/Bundle/Application/820E30D7-3CAB-41DE-B5D9-7835C81F91A8/exponativeconfigurationexample.app/Frameworks/gk_nfc_reader.framework/gk_nfc_reader
Reason: tried: 
'/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/OpenSSL.framework/OpenSSL' (no such file), 
'/usr/lib/swift/OpenSSL.framework/OpenSSL' (no such file, not in dyld cache), 
'/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/Users/priskakohnen/Library/Developer/Xcode/DerivedData/exponativeconfigurationexample-efbhjbqhfqxnwpgtldkkolknmopi/Build/Products/Debug-iphonesimulator/gk-nfc-reader/PackageFrameworks/OpenSSL.framework

It assumes that the framework should be found in the PackagesFrameworks folder of my module that I am building (the gk-nfc-reader). Which is not the case though. I am wondering if there might be some bug on your side when the HealthCardAccess and HealthCardControl frameworks are build ?

I temporarily fixed this issue by adding you OpenSSL.framework again to my ios folder and added the dependency to the .podspec. However that's not a good solution, as I need to manually keep the framework up to date.

I hope this information can help you somehow to figure out what I am doing and what might be wrong with the build process of the OpenHealthCardKit in case there is a bug.

@priska96
Copy link
Author

priska96 commented Oct 9, 2024

Actually, you can check out the full code here
gk-nfc-reader

@sigabrtz
Copy link
Contributor

Unfortunately I'm not too familiar with CocoaPods.

OpenSSL-Swift is a precompiled framework that is transitively needed by OHCKit. Maybe CocoaPods needs some more info and it helps if you explicitly express this dependency in another spm_dependency similar like we are doing in our E-Rezept-App's Package.swift https://github.com/gematik/E-Rezept-App-iOS/blob/4e62168b8599b9d404bc6c820eb53e080b6e6714/Package.swift#L94 .. (?)

Something like

spm_dependency(s,  
     url: "https://github.com/gematik/OpenSSL-Swift", 
     requirement: {kind: "upToNextMajorVersion", minimumVersion: "4.2.0"}, 
     products: ["OpenSSL-Swift"] 
   )

If not, feel free to experiment with podfiles in a branch or fork. We can't support/maintain here very much for now though

@priska96
Copy link
Author

Hey, yes I tried that already and it didn't help to fix the error. But I will try out some more and give feedback if I figured something out!

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

No branches or pull requests

2 participants