amitaymolko / react-native-rsa-native

A native implementation of RSA key generation and encryption/decryption.
MIT License
232 stars 112 forks source link

Undefined Symbols since iOS 15 and xCode 13.0 #120

Open buekera opened 2 years ago

buekera commented 2 years ago

Hey there!

I upgraded to iOS 15 on my iPhone 11 today and also had to upgrade xCode to 13.0.

After that I suddenly get a compile error with following message:

ld: warning: Could not find or use auto-linked library 'swift_Concurrency'
ld: warning: Could not find or use auto-linked library 'swiftFileProvider'
ld: warning: Could not find or use auto-linked library 'swiftDataDetection'
Undefined symbols for architecture arm64:
  "__swift_FORCE_LOAD_$_swiftDataDetection", referenced from:
      __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native in libreact-native-rsa-native.a(RNRSAKeychain-e17dea0b9d29c4050096d8d94d681426.o)
      __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native in libreact-native-rsa-native.a(RSAECFormatter.o)
      __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native in libreact-native-rsa-native.a(CSRSwift.o)
      __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native in libreact-native-rsa-native.a(RSAKeyEncoding.o)
      __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native in libreact-native-rsa-native.a(RNRSA-75c7169f9e07e322c3a7ac3341830f15.o)
      __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native in libreact-native-rsa-native.a(RSAECNative.o)
      __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native in libreact-native-rsa-native.a(CSRSwiftConstants.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftDataDetection_$_react_native_rsa_native)
  "__swift_FORCE_LOAD_$_swiftFileProvider", referenced from:
      __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native in libreact-native-rsa-native.a(RNRSAKeychain-e17dea0b9d29c4050096d8d94d681426.o)
      __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native in libreact-native-rsa-native.a(RSAECFormatter.o)
      __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native in libreact-native-rsa-native.a(CSRSwift.o)
      __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native in libreact-native-rsa-native.a(RSAKeyEncoding.o)
      __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native in libreact-native-rsa-native.a(RNRSA-75c7169f9e07e322c3a7ac3341830f15.o)
      __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native in libreact-native-rsa-native.a(RSAECNative.o)
      __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native in libreact-native-rsa-native.a(CSRSwiftConstants.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftFileProvider_$_react_native_rsa_native)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Used module version: 2.0.4

I also cleaned my workspace, updated pods, restarted xCode and my MacBook (just in case ;)).

Thanks in advance andy

FuriKuri commented 2 years ago

Same problem here.

Abhisflyingsoon commented 2 years ago

same problem...

Abhisflyingsoon commented 2 years ago

@FuriKuri @buekera I found a solution. This bugged me for at least a week. Hope this helps you guys out :)
in your pod file, under your post install add this: post_install do |installer| <---------ADD START-------> installer.aggregate_targets.first.user_project.native_targets.each do |target| target.build_configurations.each do |config| config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(inherited)', '$(SDKROOT)/usr/lib/swift'] end end

end installer.aggregate_targets.first.user_project.save

douglasjunior commented 1 year ago

Same here.

@Abhisflyingsoon your suggestion dont work for me:

image

Error:

CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'react-native-rsa-native' from project 'Pods')
    cd /Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods
    export DEVELOPER_DIR\=/Applications/Xcode.app/Contents/Developer
    export SDKROOT\=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name react_native_rsa_native -Onone -enable-batch-mode -enforce-exclusivity\=checked @/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/Objects-normal/arm64/react-native-rsa-native.SwiftFileList -DDEBUG -D COCOAPODS -Xcc -fmodule-map-file\=/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React/React-Core.modulemap -Xcc -fmodule-map-file\=/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/yoga/Yoga.modulemap -import-underlying-module -Xcc -fmodule-map-file\=/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/react_native_rsa_native/react-native-rsa-native.modulemap -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.4.sdk -target arm64-apple-ios11.0-simulator -g -module-cache-path /Users/douglas.junior/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -enable-testing -index-store-path /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Index/DataStore -swift-version 4.2 -I /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Products/Debug-iphonesimulator/react-native-rsa-native -F /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Products/Debug-iphonesimulator/react-native-rsa-native -c -j8 -output-file-map /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/Objects-normal/arm64/react-native-rsa-native-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/Objects-normal/arm64/react_native_rsa_native.swiftmodule -Xcc -I/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/react-native-rsa-native-generated-files.hmap -Xcc -I/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/react-native-rsa-native-own-target-headers.hmap -Xcc -I/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/react-native-rsa-native-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/react-native-rsa-native-project-headers.hmap -Xcc -I/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Products/Debug-iphonesimulator/react-native-rsa-native/include -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Private -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Private/react-native-rsa-native -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/DoubleConversion -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/FBLazyVector -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/RCT-Folly -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/RCTRequired -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/RCTTypeSafety -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-Codegen -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-Core -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-RCTText -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-callinvoker -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-cxxreact -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-jsi -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-jsinspector -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-logger -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-perflogger -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/React-runtimeexecutor -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/ReactCommon -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/Yoga -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/fmt -Xcc -I/Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods/Headers/Public/glog -Xcc -I/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/DerivedSources-normal/arm64 -Xcc -I/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/DerivedSources/arm64 -Xcc -I/Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -emit-objc-header -emit-objc-header-path /Users/douglas.junior/Library/Developer/Xcode/DerivedData/AppDigitalCore-crrdppbelgncaoauafruutokssvx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-rsa-native.build/Objects-normal/arm64/react_native_rsa_native-Swift.h -working-directory /Users/douglas.junior/projects/App/appdigital/appdigital-core/ios/Pods