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

multiple commands produce 'xcode/../../../deriveddata/debug-iphonesimulator/freerasp-react-native/freerasp_react_native.framework/headers/talsecruntime-swift.h' #26

Closed
jaitruworth opened this issue Jul 31, 2023 · 17 comments · Fixed by #29
Assignees
Labels
bug Something isn't working

Comments

@jaitruworth
Copy link

Describe the bug
multiple commands produce 'xcode/deriveddata/debug-iphonesimulator/freerasp-react-native/freerasp_react_native.framework/headers/talsecruntime-swift.h'

To Reproduce
just add npm add library and pod install in ios folder

Expected behavior
build to be successful

Please complete the following information:

  • Device: iPhone 14 pro [simulator]
  • OS version: 14.6
  • Version of freeRASP: 3.1.0
@jaitruworth jaitruworth added the bug Something isn't working label Jul 31, 2023
@jaitruworth
Copy link
Author

also followed steps to add code to app and add binary to app and getting same issue

@tompsota
Copy link
Member

Hi @jaitruworth,

Unfortunately I wasn't able to reproduce the error. Please, share the whole stack trace of the error if possible.

For now, I would suggest reinstalling pods, maybe that could solve the problem:

In ios folder, run these commands:

  1. pod deintegrate
  2. pod cache clean --all
  3. pod install

Let us know if this helps.

Best,
Tomas, Talsec developer

@jaitruworth
Copy link
Author

  1. added library to npm (npm install)
  2. cd ios
  3. pod deintegrate
  4. pod cache clean --all
  5. pod install --verbose
  6. then run from Xcode and fails

there are 15 similar "Multiple commands produce" errors 2 of them are shown below

Multiple commands produce '/Users/../Library/Developer/Xcode/DerivedData/appname-ewsgfwgfwsjwrbcdprlujuzitvvy/Build/Products/Debug-iphonesimulator/freerasp-react-native/freerasp_react_native.framework/Headers/CryptoBridgingHeader.h'

Multiple commands produce '/Users/../Library/Developer/Xcode/DerivedData/..-ewsgfwgfwsjwrbcdprlujuzitvvy/Build/Products/Debug-iphonesimulator/freerasp-react-native/freerasp_react_native.framework/Headers/CurlWrapper.h'

Multiple commands produce '/Users/../Library/Developer/Xcode/DerivedData/..-ewsgfwgfwsjwrbcdprlujuzitvvy/Build/Products/Debug-iphonesimulator/freerasp-react-native/freerasp_react_native.framework/Headers/TalsecRuntime-Swift.h'

@jaitruworth
Copy link
Author

Screenshot 2023-08-01 at 15 18 59

These

  1. ios-arm64
  2. ios-arm64_×86_64-simulator

two folder both contains
TalsecRuntime-Swift.h
CurlWrapper.h
CryptoBridgingHeader.h
& 12 more files that triggers multiple commands produce error

can you please help me with this?

@tompsota
Copy link
Member

tompsota commented Aug 1, 2023

Hi @jaitruworth,

we'll do our best to fix the issue.

These folders are not duplicates and are not reason of the error. They include binary code for multiple architectures, allowing it to run on different devices and simulators.

We still didn't reproduce the issue. Can you please answer following questions?

  1. Is this a new installation of freeRASP, or are you upgrading from a previous version?
  2. What version of XCode are you using?
  3. Do you run app with Rosetta?
  4. In your app's target in XCode, go to General -> Frameworks, Libraries and Embedded Content. Do you see TalsecRuntime.xcframework listed there?
  5. Do you see TalsecRuntime.xcframework in Build Phases -> Link Binary With Libraries?
    Also, please look inside "Build Phases" tab for any build phase (e.g., "Copy Headers," "Copy Files," "Compile Sources") that may be generating conflicting files and causing the conflict. If you find multiple build phases generating these files, delete one of them.

@jaitruworth
Copy link
Author

hii @tompsota Any update on this ??

@tompsota
Copy link
Member

tompsota commented Aug 2, 2023

Hello @jaitruworth,

Could you please respond to the questions in my previous message? You can find them in this link: #26 (comment).

We performed a clean install of freeRASP and did not encounter any errors, therefore your answers will be valuable in identifying the issue.

@jaitruworth
Copy link
Author

  1. New installation
  2. Xcode 14.1
  3. Rosetta? - no
  4. Frameworks, Libraries and Embedded Content. - can't see framework here
  5. Link Binary With Libraries? - can't see framework here
  6. Copy Headers," "Copy Files," "Compile Sources" - no duplicate found

@jaitruworth
Copy link
Author

added library to Frameworks, Libraries and Embedded Content and Link Binary With Libraries? and got same issue

Found library in Embed Frameworks in Build phases

also removed from there and checked, still got same issue

@tompsota
Copy link
Member

tompsota commented Aug 3, 2023

Hi @jaitruworth,

we just released new version, let's see if the problem still persists. Try to remove everything related to freeRASP first and try to do a clean install:

  1. npm uninstall freerasp-react-native (or delete node_modules and remove freerasp from package.json)
  2. cd ios
  3. pod deintegrate
  4. pod cache clean --all
  5. cd ..
  6. npm install freerasp-react-native
  7. cd ios
  8. pod install

Ensure that freerasp 3.3.0 is installed. Try to run the app and let us know if this helped.

@jaitruworth
Copy link
Author

Still same issue
Version 3.3.0 is installed
Followed all steps you mentioned

@gansu18
Copy link
Contributor

gansu18 commented Aug 11, 2023

@jaitruworth #11

@tompsota
Copy link
Member

Hi and sorry for late reply,
thanks @gansu18 for pointing this out!

@jaitruworth, can you check if you have use_frameworks! in your Podfile and eventually remove it?
freeRASP is shipped as a static library, therefore dynamic linking with use_frameworks! will lead to duplicate class error.

@Suliman-A
Copy link

Hi and sorry for late reply, thanks @gansu18 for pointing this out!

@jaitruworth, can you check if you have use_frameworks! in your Podfile and eventually remove it? freeRASP is shipped as a static library, therefore dynamic linking with use_frameworks! will lead to duplicate class error.

I only have this line use_frameworks! :linkage => :static in my Podfile and i don't think it's a good idea to remove it.

@jaitruworth
Copy link
Author

yes removing use_frameworks breaks other library that we are using

@tompsota
Copy link
Member

tompsota commented Aug 16, 2023

Hi @jaitruworth, @Suliman-A, @gansu18,

Indeed, if some other package require use_frameworks!, then you cannot remove it. However, I finally reproduced the problem and found a way to fix it.

Fix:

  1. Go to node_modules/freerasp-react-native/freerasp-react-native.podspec
  2. After a line that starts with 's.source_files' (line 17), add this code that removes the duplicate headers:
    s.exclude_files = 'ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/*.h', 'ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/*.h'
  3. Run pod install.

After that, the project should build successfully.

Hope this helps.

We'll have to do some more testing until we are able to release this globally, to ensure compatibility with projects that do not use the use_frameworks! directive. However, in your case, everything will work as expected.

@tompsota
Copy link
Member

Hi @jaitruworth @Suliman-A ,

We just released v3.3.1, which fixes the issue.

Best,
Tomas, Talsec developer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants