lottie-react-native: Unable to build with React Native 0.61

Description

Installed lottie-react-native into our react native project. Although we’re using RN 0.61, we were unable follow the latest steps so had to add them in manually.

We have added both packages to our package.json file and added the following lines to our Podfile

pod 'lottie-react-native', :path => '../node_modules/lottie-react-native' pod 'lottie-ios', '~> 3.1.3'

When we build, we get the following errors:

Undefined symbols for architecture x86_64:
  "_swift_getFunctionReplacement", referenced from:
      _swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o)
     (maybe you meant: _swift_getFunctionReplacement50)
  "_swift_getOrigOfReplaceable", referenced from:
      _swift_getOrigOfReplaceable50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o)
     (maybe you meant: _swift_getOrigOfReplaceable50)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 15
  • Comments: 19

Most upvoted comments

I solved the problem in that way.

  1. yarn add lottie-react-native yarn add lottie-ios@3.1.3

  2. pod install (in the ios folder of course)

  3. open .xcworkspace file

  4. Select your project folder Schermata 2019-10-12 alle 13 15 10

  5. Create new Swift File (remember the targets) Schermata 2019-10-12 alle 13 16 31

  6. It will automatically appear this view -> Specify “Create Bridging Header”. Schermata 2019-10-12 alle 13 17 08

  7. Go to your project Build Settings, you should see those stuffs. Schermata 2019-10-12 alle 13 18 53

  8. Clean your project and run

react-native run-ios

I solved the problem in that way.

  1. yarn add lottie-react-native yarn add lottie-ios@3.1.3
  2. pod install (in the ios folder of course)
  3. open .xcworkspace file
  4. Select your project folder
Schermata 2019-10-12 alle 13 15 10
  1. Create new Swift File (remember the targets)
Schermata 2019-10-12 alle 13 16 31
  1. It will automatically appear this view -> Specify “Create Bridging Header”. Schermata 2019-10-12 alle 13 17 08

  2. Go to your project Build Settings, you should see those stuffs. Schermata 2019-10-12 alle 13 18 53

  3. Clean your project and run

react-native run-ios

AND ADD THIS WORK FOR ME:

remove “Library search paths” $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) OR/AND remove “Library search paths” $(TOOLCHAIN_DIR)/usr/lib/swift5.0/$(PLATFORM_NAME)

I added another step to the subordinate step。

"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

Simultaneously,set Dead Code Stripping to YES image

This work for me

@roubo

This was the culprit:

remove "Library search paths" $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
OR/AND
remove "Library search paths" $(TOOLCHAIN_DIR)/usr/lib/swift5.0/$(PLATFORM_NAME)

^^ That doesn’t fix it for me. Any other ideas?

I have the same issue. Build works fine but have this issue when try to create an archive. Swift file and bridge header already created. Tried to use the latest version and the one that in the post above.