Why linker link static libraries with errors? iOS

后端 未结 17 1290
自闭症患者
自闭症患者 2020-11-27 14:39

I have a problem with linking my mixed language framework to a project.

1) I create a framework with Swift and Objective-C classes.

2) The main logic was stored in the

相关标签:
17条回答
  • 2020-11-27 15:12

    What solved it for me when trying to integrate Lottie in my React Native project was to uninstall the lottie-ios and lottie-react-native modules with npm.

    npm uninstall lottie-react-native lottie-ios
    

    Make sure the files are unlinked as well

    npx react-native unlink lottie-react-native lottie-ios
    

    I also had the bridging-file in my project from previously trying that method without success so in order to replicate my process, follow the suggested answer and add that file to your project as well.

    After these steps, I went ahead and deleted my Pods folder, cleaned my build from xcproject and xcworkspace (maybe one of these is enough). After that I went ahead and installed the modules again

    npm i --save lottie-react-native lottie-ios@3.1.3
    

    (Make sure to check the current docks over at the lottie repo for the up-to-date versions.)

    After you have reinstalled the modules, cd into your ios folder and run pod install.

    Open up your xcworkspace in Xcode and run your project (make sure your build is clean).

    This solved my issue.

    Best of luck.

    0 讨论(0)
  • 2020-11-27 15:14

    I've got the same errors when accidentally compiling a project with a Swift 5.0 Snapshot configured in the Xcode preferences » Components » Toolchain.

    0 讨论(0)
  • 2020-11-27 15:14

    XCode 11.3 beta, Swift 5.0

    I just add my targets to the podfile:

    platform :ios, '9.0' 
    use_frameworks! 
    inhibit_all_warnings!
    
    def shared_pods
        # Pods for NamaIOS
        pod 'Alamofire'
        pod 'RxSwift'
    end
    
    target 'MyApp' do
      use_frameworks!
    
      shared_pods
    
    end
    
    target 'MyApp-Test' do
      use_frameworks!
    
      shared_pods
    
    end
    
    target 'MyApp-Development' do
      use_frameworks!
    
      shared_pods
    
    end
    
    0 讨论(0)
  • 2020-11-27 15:15

    For XCode 11 beta 4 Library Search Paths should be:

    $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
    
    0 讨论(0)
  • 2020-11-27 15:17
    1. Open ios/YourAppName.xcodeproj in Xcode
    2. Right-click on Your App Name in the Project Navigator on the left, and click New File…
    3. Create a single empty Swift file to the project (make sure that Your App Name target is selected when adding)
    4. when Xcode asks, press Create Bridging Header and do not remove Swift file then. re-run your build.

    This should fix the problem

    0 讨论(0)
提交回复
热议问题