Skip to content

XCode 14.X Library not loaded error #59

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

Open
dgalitsyn opened this issue May 24, 2023 · 7 comments
Open

XCode 14.X Library not loaded error #59

dgalitsyn opened this issue May 24, 2023 · 7 comments

Comments

@dgalitsyn
Copy link

Hi @SergeySeroshtan,

I'm not sure if this is the correct repo to raise the issue.

I am getting a library not found error when compiling our app on XCode 14.2 or 14.3, please see below:

dyld[83764]: Library not loaded: @rpath/VirgilCrypto.framework/VirgilCrypto
  Referenced from: <1DA6F60D-DCD2-3BEA-A398-6AC15CA41760> /Users/denisgalitsyn/Library/Developer/CoreSimulator/Devices/7BC75890-E0B9-4EDA-8623-124807D54429/data/Containers/Bundle/Application/F97D0BD9-E516-4DA7-9E14-F522CDB2E5B4/guestApp.app/Frameworks/ClaySDK.framework/ClaySDK
  Reason: tried: '/Users/denisgalitsyn/Library/Developer/Xcode/DerivedData/guestApp-glsgagohkradmoellyszixviczpi/Build/Products/Debug-iphonesimulator/VirgilCrypto.framework/VirgilCrypto' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/VirgilCrypto.framework/VirgilCrypto' (no such file), '/usr/lib/swift/VirgilCrypto.framework/VirgilCrypto' (no such file, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/VirgilCrypto.framework/VirgilCrypto' (no such file), '/usr/lib/swift/VirgilCrypto.framework/VirgilCrypto' (no such file, not in dyld cache), '/Users/denisgalitsyn/Library/Developer/CoreSimulator/Devices/7BC75890-E0B9-4EDA-8623-124807D54429/data/Containers/Bundle/Application/F97D0BD9-E516-4DA7-9E14-F522CDB2E5B4/guestApp.app/Frameworks/VirgilCrypto.framework/VirgilCrypto' (no such file), '/Users/denisgalitsyn/Library/Developer/CoreSimulator/Devices/7BC75890-E0B9-4EDA-8623-124807D54429/data/Containers/Bundle/Application/F97D0BD9-E516-4DA7-9E14-F522CDB2E5B4/guestApp.app/Frameworks/ClaySDK.framework/Frameworks/VirgilCrypto.framework/VirgilCrypto' (no s

etc

This library is included by another dependency we use. However, not matter what I try, I am always get this error. However when I check the derived data folder, there is a VirgilCrypto folder with the following files in there:
96 24 May 13:09 Swift Compatibility Header
316 24 May 10:09 VirgilCrypto-umbrella.h
356 24 May 13:09 VirgilCrypto.modulemap
192 24 May 13:09 VirgilCrypto.swiftmodule
644696 24 May 13:09 libVirgilCrypto.a

This is a react native project, so not sure if this is something to go by. I am not an ios dev so not sure how to proceed here. Do you have any idea?

Regards, Denis.

@SergeySeroshtan
Copy link
Member

Hi @dgalitsyn. Can you provide next information:

  1. output of command file /path/to/libVirgilCrypto.a
  2. package manager that is used in the project: spm, cathage, cocoapods
  3. version of the ClaySDK
  4. ideally provide example xcodeproject that reproduce this error

@dgalitsyn
Copy link
Author

dgalitsyn commented May 25, 2023

Hi @SergeySeroshtan,

Thank you for your reply.

  1. output of command file /path/to/libVirgilCrypto.a

-rw-r--r-- 1 denisgalitsyn staff 644696 24 May 16:52 libVirgilCrypto.a
denisgalitsyn@Deniss-MacBook-Pro VirgilCrypto % file libVirgilCrypto.a
libVirgilCrypto.a: current ar archive

  1. package manager that is used in the project: spm, cathage, cocoapods

I use cocoapods

  1. version of the ClaySDK

We have access to their newer version of the their SDK from their gitlab. Version 2.0.1. I think one of the devs from clay said they have a dependency on VirgilCrypto 6.1.0

  1. ideally provide example xcodeproject that reproduce this error

Unfortunately I cannot provide our version of the project. However there is a sample claysdk demo ios app from their gitlab, which has a simple podfile as follows, but you need gitlab username/password from clay to get access, which I am not sure if you do have.

source 'https://github.com/CocoaPods/Specs.git'
source 'https://{YOUR_REPO_USER}:{YOUR_TOKEN}@gitlab.com/claysolutions/public/clay-sdk-artefacts'
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

target 'Demo' do
  platform :ios, '13.0'
  pod 'ClaySDK', :git => 'https://gitlab.com/claysolutions/public/clay-sdk-artefacts', :tag => '2.0.1'
  pod 'AppAuth'
end

target 'DemoWatchOS WatchKit Extension' do
  platform :watchos, '7.0'
  pod 'ClaySDK', :git => 'https://gitlab.com/claysolutions/public/clay-sdk-artefacts', :tag => '2.0.1'
end

Thanks. 🇺🇦🇺🇦🇺🇦

@dgalitsyn
Copy link
Author

dgalitsyn commented May 25, 2023

Just an addition to the above, if its any help.
I had to set the Build Libraries for Distribution to NO for all of our pods as setting this to YES breaks the build and never compiles. Not sure if thats any help or not.

And our minimum target ios version is 13.

@dgalitsyn
Copy link
Author

Hi @SergeySeroshtan, any update?

@SergeySeroshtan
Copy link
Member

I'm a volunteer on this project. So responses and solving will be delayed for sure. Please, wait for a while. Thank you for understanding.

@SergeySeroshtan
Copy link
Member

Hi @dgalitsyn.
I've created a demo project based on VirgilSDK only, and it compiles and runs on iOS simulator.
Please to reproduce this demo locally.

  1. Create empty IOS app project with name 'VirgilSDKdemo'.
  2. Add Podfile to the root with content
platform :ios, '13.0'

target 'VirgilSDKdemo' do
    use_frameworks!
    pod 'VirgilSDK', '~> 8.2'
end
  1. Put next content to ContentView.swift
import SwiftUI
import VirgilCrypto

extension Data {
    struct HexEncodingOptions: OptionSet {
        let rawValue: Int
        static let upperCase = HexEncodingOptions(rawValue: 1 << 0)
    }

    func hexEncodedString(options: HexEncodingOptions = []) -> String {
        let format = options.contains(.upperCase) ? "%02hhX" : "%02hhx"
        return self.map { String(format: format, $0) }.joined()
    }
}

struct ContentView: View {
    func getHash() -> String {
        do {
            let greating = "hello"
            let data = greating.data(using: .ascii)
            let crypto = try VirgilCrypto()
            let digest = crypto.computeHash(for: data!, using: .sha512);
            return "sha512('\(greating)') = \(digest.hexEncodedString())"
        } catch {
            return "crypto error: \(error)"
        }
    }
    
    var body: some View {
        VStack {
            Text("🇺🇦🇺🇦🇺🇦");
            Text(getHash())

        }
        .padding()
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
  1. Run pod install
  2. Run project on simulator

@dgalitsyn
Copy link
Author

Hi @SergeySeroshtan,

I think I have raised the issue on the wrong repo.

Can you try Xcode 14.3 and VirgilCrypto ~> 6.1.0 building for ios 13+ and without useframeworks?

This is the setup we use and I am getting the result I first described.

Thanks.

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