talsec / Free-RASP-Flutter

Flutter library for improving app security and threat monitoring on Android and iOS mobile devices.
https://github.com/talsec/Free-RASP-Community
MIT License
194 stars 20 forks source link

bug: iOS getting build errors #65

Closed Zaveri21 closed 1 year ago

Zaveri21 commented 1 year ago

iOS pod install time getting errors i am integrating package 2 days ago and not getting errors after that this new package version i am getting pod install error. as per latest documentation removed all scripts from scheme which mentioned in old documentation.

Errno::ENOENT - No such file or directory @ rb_check_realpath_internal - <App_path> /ios/.symlinks/plugins/freerasp/ios/TalsecRuntime.xcframework
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/project.rb:326:in `realpath'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/project.rb:326:in `realpath'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/project.rb:326:in `reference_for_path'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/project.rb:269:in `add_file_reference'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:228:in `block (2 levels) in add_file_accessors_paths_to_pods_group'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:227:in `map'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:227:in `block in add_file_accessors_paths_to_pods_group'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:217:in `each'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:217:in `flat_map'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:217:in `add_file_accessors_paths_to_pods_group'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:99:in `block in add_source_files_references'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:149:in `message'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:98:in `add_source_files_references'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:49:in `install!'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator.rb:102:in `block in install_file_references'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:149:in `message'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/pods_project_generator.rb:100:in `install_file_references'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:17:in `generate!'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:320:in `block in create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:315:in `create_and_save_projects'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:307:in `generate_pods_project'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:183:in `integrate'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:170:in `install!'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.12.0/libexec/bin/pod:25:in `<main>'

https://github.com/CocoaPods/CocoaPods/search?q=No+such+file+or+directory+%40+rb_check_realpath_internal+-+%2<project_app_path>2Fios%2F.symlinks%2Fplugins%2Ffreerasp%2Fios%2FTalsecRuntime.xcframework&type=Issues

System configuration

msikyna commented 1 year ago

Hello @Zaveri21 , thank you for reporting this. We are actively looking in to the issue.

Kind regards, Talsec team

yardexx commented 1 year ago

Hello!

I am really sorry for the inconvenience. We are actively investigating the issue.

Currently, we are suspecting pod cache. Can you clean pod caches and try it again?

pod cache clean --all
yardexx commented 1 year ago

Can you try to remove .symlinks folder which contains freerasp and then run pod install again?

Zaveri21 commented 1 year ago

Thanks for the quick support 👍 yes, tried but still getting same error.

 CocoaPods : 1.12.0
        Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
    RubyGems : 3.4.10
        Host : macOS 13.3.1 (22E261)
       Xcode : 14.3 (14E222b)
Ruby lib dir : /opt/homebrew/Cellar/ruby/3.2.2/lib

can you check anything above i need to update ?

yardexx commented 1 year ago

Hello.

We managed to pinpoint the issue and found a way to fix the issue:

  1. Remove freerasp from your pubspec.yaml (by commenting line or running dart pub remove)
  2. Run pub getto sync dependencies
  3. Clean pub cache by running dart pub cache clean
  4. Confirm it by typing y
  5. Delete .symlinks folder from project
  6. Clean pod cache by running pod cache clean --all
  7. Add freerasp back to your project
  8. Run pub get
  9. Run pod install to test it

Hope this helps.

Zaveri21 commented 1 year ago

Thanks for the help but after performing above steps but still getting same error result.

msikyna commented 1 year ago

Hello @Zaveri21 , the issue might be a different cache folder. Could you try the following?:

  1. Open the .flutter-plugins (in the root folder of the app), and get the address, where the freerasp is installed.
  2. Remove the whole freerasp-5.0.0 folder from that address.
  3. Delete .symlinks folder from project.
  4. Run pub get
  5. Run pod install to test it

Did it work?

Zaveri21 commented 1 year ago

sorry, above solution also not worked for me!. if i removed freerasp: ^5.0.0 package and apply pod install, pods installed successfully and after that again re-added freerasp: ^5.0.0 but again getting same errors.

msikyna commented 1 year ago

The issue is in the retained cache from older version of freeRASP. Have you cleaned the cache exactly as specified in the previous step? https://github.com/talsec/Free-RASP-Flutter/issues/65#issuecomment-1551264017

yardexx commented 1 year ago

Hello.

Were you able to resolve this issue?

Kind regards, Jaroslav, Talsec team

Zaveri21 commented 1 year ago

Hello.

Were you able to resolve this issue?

Kind regards, Jaroslav, Talsec team

Sorry not resolved this issue. thanks for the support.

ladla8602 commented 1 year ago

Hello.

We managed to pinpoint the issue and found a way to fix the issue:

  1. Remove freerasp from your pubspec.yaml (by commenting line or running dart pub remove)
  2. Run pub getto sync dependencies
  3. Clean pub cache by running dart pub cache clean
  4. Confirm it by typing y
  5. Delete .symlinks folder from project
  6. Clean pod cache by running pod cache clean --all
  7. Add freerasp back to your project
  8. Run pub get
  9. Run pod install to test it

Hope this helps.

Thanks @yardexx I was getting the same error and this worked for me and error gone but getting issue with ios build. Here is the my log please check.

PhaseScriptExecution [CP]\ Copy\ XCFrameworks /Users/mohdgayasuddin/Library/Developer/Xcode/DerivedData/Runner-chavmhqymkkloubjbjvyfnfxobmp/Build/Intermediates.noindex/Pods.build/Debug-uat-iphoneos/freerasp.build/Script-25932C332ED339ADF3E0604C7A38C235.sh (in target 'freerasp' from project 'Pods') cd /Users/mohdgayasuddin/Documents/www/mobile-app/ios/Pods /bin/sh -c /Users/mohdgayasuddin/Library/Developer/Xcode/DerivedData/Runner-chavmhqymkkloubjbjvyfnfxobmp/Build/Intermediates.noindex/Pods.build/Debug-uat-iphoneos/freerasp.build/Script-25932C332ED339ADF3E0604C7A38C235.sh

Selected xcframework slice ios-arm64 rsync --delete -av --filter P ..?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" "/Users/mohdgayasuddin/Documents/www/mobile-app/ios/Pods/../.symlinks/plugins/freerasp/ios/TalsecRuntime.xcframework/ios-arm64/" "/Users/mohdgayasuddin/Library/Developer/Xcode/DerivedData/Runner-chavmhqymkkloubjbjvyfnfxobmp/Build/Products/Debug-uat-iphoneos/XCFrameworkIntermediates/freerasp" building file list ... rsync: link_stat "/Users/mohdgayasuddin/Documents/www/mobile-app/ios/Pods/../.symlinks/plugins/freerasp/ios/TalsecRuntime.xcframework/ios-arm64//*" failed: No such file or directory (2) done

sent 29 bytes received 20 bytes 98.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9] Command PhaseScriptExecution failed with a nonzero exit code

hmhung2531991 commented 1 year ago

Hello. We managed to pinpoint the issue and found a way to fix the issue:

  1. Remove freerasp from your pubspec.yaml (by commenting line or running dart pub remove)
  2. Run pub getto sync dependencies
  3. Clean pub cache by running dart pub cache clean
  4. Confirm it by typing y
  5. Delete .symlinks folder from project
  6. Clean pod cache by running pod cache clean --all
  7. Add freerasp back to your project
  8. Run pub get
  9. Run pod install to test it

Hope this helps.

Thanks @yardexx I was getting the same error and this worked for me and error gone but getting issue with ios build. Here is the my log please check.

PhaseScriptExecution [CP]\ Copy\ XCFrameworks /Users/mohdgayasuddin/Library/Developer/Xcode/DerivedData/Runner-chavmhqymkkloubjbjvyfnfxobmp/Build/Intermediates.noindex/Pods.build/Debug-uat-iphoneos/freerasp.build/Script-25932C332ED339ADF3E0604C7A38C235.sh (in target 'freerasp' from project 'Pods') cd /Users/mohdgayasuddin/Documents/www/mobile-app/ios/Pods /bin/sh -c /Users/mohdgayasuddin/Library/Developer/Xcode/DerivedData/Runner-chavmhqymkkloubjbjvyfnfxobmp/Build/Intermediates.noindex/Pods.build/Debug-uat-iphoneos/freerasp.build/Script-25932C332ED339ADF3E0604C7A38C235.sh

Selected xcframework slice ios-arm64 rsync --delete -av --filter P ..?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" "/Users/mohdgayasuddin/Documents/www/mobile-app/ios/Pods/../.symlinks/plugins/freerasp/ios/TalsecRuntime.xcframework/ios-arm64/" "/Users/mohdgayasuddin/Library/Developer/Xcode/DerivedData/Runner-chavmhqymkkloubjbjvyfnfxobmp/Build/Products/Debug-uat-iphoneos/XCFrameworkIntermediates/freerasp" building file list ... rsync: link_stat "/Users/mohdgayasuddin/Documents/www/mobile-app/ios/Pods/../.symlinks/plugins/freerasp/ios/TalsecRuntime.xcframework/ios-arm64//*" failed: No such file or directory (2) done

sent 29 bytes received 20 bytes 98.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9] Command PhaseScriptExecution failed with a nonzero exit code

same issue

yardexx commented 1 year ago

Hello.

I have checked the logs and it seems like some script is trying to link freerasp:

list ... rsync: link_stat "/Users/mohdgayasuddin/Documents/www/mobile-app/ios/Pods/../.symlinks/plugins/freerasp/ios/TalsecRuntime.xcframework/ios-arm64//*" failed: No such file or directory (2)

Have you removed the integration script (which you had to have in previous versions)?

To check and remove the script:

  1. Open app in XCode
  2. Go to Product > Scheme > Edit Scheme...
  3. Select Pre-Actions
  4. Pre-Actions should be empty (if you don't use it for something else)
  5. If script is there, remove it by clicking trash icon image
  6. Pre-actions should be empty now.
  7. Re-apply cache clean if necessary
msikyna commented 1 year ago

Hello @hmhung2531991 , @ladla8602 , @Zaveri21 , have you managed to solve the issue using the steps @yardexx described above? Thank you!

Kind regards, Talsec team

besher-altobeh commented 1 year ago

Thank you @yardexx I faced the same issue and your solutions works for me