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

Error in Latest versions (3.0.1) #511

Closed
cheeaun opened this issue Jul 4, 2019 · 62 comments
Closed

Error in Latest versions (3.0.1) #511

cheeaun opened this issue Jul 4, 2019 · 62 comments

Comments

@cheeaun
Copy link

cheeaun commented Jul 4, 2019

From the changelog, version 3.0.0 and 3.0.1 are released. On npm, both versions are not available.

Any plans on publishing?

@owinter86
Copy link

It would be good to get these released to npm as the build gradle update changing the react native dependency from compileOnly to implementation fixes the error when running the jettifier post install script which has is the preferred method to migrate to androidX and RN 0.60.

react-native-maps/react-native-maps#2940

@emilioicai
Copy link
Member

I'm having some issues building I want to make sure they are fixed before publishing. Hopefully 3.0.1 should be on npm later today. Sorry for the confusion

@emilioicai
Copy link
Member

Done! @owinter86 @cheeaun Could you guys do me a favor and test if everything is working fine for you? I think I managed to fix all the issues but it would be great to have a some other real projects running lottie-react-native 3.0.1 to confirm everything is OK

@StanislavMayorov
Copy link

@emilioicai
I have pod install error:

[!] CocoaPods could not find compatible versions for pod "lottie-ios":
  In Podfile:
    lottie-ios (from `../node_modules/lottie-ios`)

    lottie-react-native (from `../node_modules/lottie-react-native`) was resolved to 3.0.1, which depends on
      lottie-ios (~> 3.0.4)

lottie-react-native 3.0.1. I think there's the error because pacakge.json dependency lottie-ios 3.0.3

@alimek
Copy link

alimek commented Jul 10, 2019

I have different problem:

unknown>:0: error: filename "TextCompositionLayer.swift" used twice: 'XXX/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift' and 'XXX/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name

I have linked the ios-lottie and lottie-react-native manually

@emilioicai emilioicai changed the title Latest versions are not published to npm Error in Latest versions (3.0.1) Jul 10, 2019
@mysport12
Copy link

mysport12 commented Jul 10, 2019

@StanislavMayorov I can confirm that the pod install issue is due to the incorrect lottie-ios version specified in the podspec file. Should be 3.0.3 not 3.0.4.

@mysport12
Copy link

@StanislavMayorov Was able to workaround the issue for now by switching

pod 'lottie-ios', :path => '../node_modules/lottie-ios'

to

pod 'lottie-ios', '~> 3.0.4'

in my Podfile. Hope that helps

@LaurieWilliamsNZ
Copy link

LaurieWilliamsNZ commented Jul 11, 2019

Followed your advice @mysport12

I can now install the pod but getting

The Swift pod lottie-react-native depends upon React, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

@LaurieWilliamsNZ
Copy link

LaurieWilliamsNZ commented Jul 11, 2019

Adding use_modular_headers! to the podfile allows the pods to be installed correctly. Thanks again @mysport12

@lyqht
Copy link

lyqht commented Jul 12, 2019

Adding use_modular_headers allows the pods to be installed correctly, but when building the app, i got the following error

⚠️  ld: directory not found for option '-L/Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/ios/build/dsPlayground/Build/Products/Debug-iphonesimulator/React'
⚠️  ld: directory not found for option '-L/Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/ios/build/dsPlayground/Build/Products/Debug-iphonesimulator/yoga'
⚠️  ld: Could not find auto-linked library 'swiftCoreFoundation'
⚠️  ld: Could not find auto-linked library 'swiftQuartzCore'
⚠️  ld: Could not find auto-linked library 'swiftCore'
⚠️  ld: Could not find auto-linked library 'swiftCoreGraphics'
⚠️  ld: Could not find auto-linked library 'swiftObjectiveC'
⚠️  ld: Could not find auto-linked library 'swiftDispatch'
⚠️  ld: Could not find auto-linked library 'swiftSwiftOnoneSupport'
⚠️  ld: Could not find auto-linked library 'swiftDarwin'
⚠️  ld: Could not find auto-linked library 'swiftUIKit'
⚠️  ld: Could not find auto-linked library 'swiftCoreImage'
⚠️  ld: Could not find auto-linked library 'swiftFoundation'
⚠️  ld: Could not find auto-linked library 'swiftMetal'
⚠️  ld: Could not find auto-linked library 'swiftCoreLocation'

❌  ld: symbol(s) not found for architecture x86_64



❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)


error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening dsPlayground.xcworkspace

** BUILD FAILED **


The following commands produced analyzer issues:
        Analyze /Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/node_modules/react-native/ReactCommon/jsi/jsi.cpp normal x86_64
        Analyze /Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp normal x86_64
        Analyze /Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/node_modules/react-native/React/Base/RCTModuleMethod.mm normal x86_64
(3 commands with analyzer issues)

The following build commands failed:
        Ld /Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/ios/build/dsPlayground/Build/Products/Debug-iphonesimulator/dsPlayground.app/dsPlayground normal x86_64
(1 failure)

@DaiYz
Copy link

DaiYz commented Jul 12, 2019

@lyqht same issue

@xks19943
Copy link

@lyqht How do you solve this problem? tanks

@xks19943
Copy link

@lyqht hello, i find the way. https://stackoverflow.com/questions/52536380/why-linker-link-static-libraries-with-errors-ios/53101587# i use second way

@emilioicai
Copy link
Member

Guys, I just released 3.0.2 fixing the lottie-ios 3.0.3 dependency issue but I'm afraid there are more issues, specially when using RN 0.60.0. I would really appreciate if you guys could send any issues you are facing, including versions of RN and lottie-react-native.

Thanks!

@Hiro5409
Copy link

@emilioicai
After upgrade to 3.0.2, the error still exists… 😭

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

RN version: 0.59.10
lottie-react-native: 3.0.2

@JakeHadley
Copy link

JakeHadley commented Jul 13, 2019

I guess I should mention I'm on RN 0.59, "lottie-ios": "^3.0.3", and "lottie-react-native": "^3.0.1",
I'm getting this still:

[!] CocoaPods could not find compatible versions for pod "lottie-ios":
  In Podfile:
    lottie-ios (from `../node_modules/lottie-ios`)

    lottie-react-native (from `../node_modules/lottie-react-native`) was resolved to 3.0.1, which depends on
      lottie-ios (~> 3.0.4)

I then change this
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
to
pod 'lottie-ios', '~> 3.0.4'
and get this:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. 
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), 
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Putting :modular_headers => true on pod 'lottie-react-native', :path => '../node_modules/lottie-react-native' gives the same error.
Putting use_modular_headers! at the top of the pod file, pod install runs successfully. But when I build it, I get additional errors:

Import of module 'glog.glog.log_severity' appears within namespace 'google'

I then tried what was described here and got this:

Declaration of 'RCTImageLoaderCancellationBlock' must be imported from module 'React.RCTGIFImageDecoder' before it is required

And that's where I'm stuck.

@tokinonagare
Copy link

tokinonagare commented Jul 15, 2019

I have different problem:

unknown>:0: error: filename "TextCompositionLayer.swift" used twice: 'XXX/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift' and 'XXX/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name

I have linked the ios-lottie and lottie-react-native manually

I solved by this patch(delete the duplicate file).

diff --git a/node_modules/lottie-ios/Lottie.xcodeproj/project.pbxproj b/node_modules/lottie-ios/Lottie.xcodeproj/project.pbxproj
index d6c2aa0..f6aecc8 100644
--- a/node_modules/lottie-ios/Lottie.xcodeproj/project.pbxproj
+++ b/node_modules/lottie-ios/Lottie.xcodeproj/project.pbxproj
@@ -168,7 +168,6 @@
 		486E8830220B78E4007CD915 /* PointValueProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E871E220B78BF007CD915 /* PointValueProvider.swift */; };
 		486E8831220B78E4007CD915 /* CompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8722220B78BF007CD915 /* CompositionLayer.swift */; };
 		486E8832220B78E4007CD915 /* NullCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8723220B78BF007CD915 /* NullCompositionLayer.swift */; };
-		486E8833220B78E4007CD915 /* TextCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8724220B78BF007CD915 /* TextCompositionLayer.swift */; };
 		486E8834220B78E4007CD915 /* SolidCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8725220B78BF007CD915 /* SolidCompositionLayer.swift */; };
 		486E8835220B78E4007CD915 /* PreCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8726220B78BF007CD915 /* PreCompositionLayer.swift */; };
 		486E8836220B78E4007CD915 /* ImageCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8727220B78BF007CD915 /* ImageCompositionLayer.swift */; };
@@ -285,7 +284,6 @@
 		486E88A5220B78F4007CD915 /* PointValueProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E871E220B78BF007CD915 /* PointValueProvider.swift */; };
 		486E88A6220B78F4007CD915 /* CompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8722220B78BF007CD915 /* CompositionLayer.swift */; };
 		486E88A7220B78F4007CD915 /* NullCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8723220B78BF007CD915 /* NullCompositionLayer.swift */; };
-		486E88A8220B78F4007CD915 /* TextCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8724220B78BF007CD915 /* TextCompositionLayer.swift */; };
 		486E88A9220B78F4007CD915 /* SolidCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8725220B78BF007CD915 /* SolidCompositionLayer.swift */; };
 		486E88AA220B78F4007CD915 /* PreCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8726220B78BF007CD915 /* PreCompositionLayer.swift */; };
 		486E88AB220B78F4007CD915 /* ImageCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8727220B78BF007CD915 /* ImageCompositionLayer.swift */; };
@@ -406,7 +404,6 @@
 		486E891E220B78FF007CD915 /* PointValueProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E871E220B78BF007CD915 /* PointValueProvider.swift */; };
 		486E891F220B78FF007CD915 /* CompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8722220B78BF007CD915 /* CompositionLayer.swift */; };
 		486E8920220B78FF007CD915 /* NullCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8723220B78BF007CD915 /* NullCompositionLayer.swift */; };
-		486E8921220B78FF007CD915 /* TextCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8724220B78BF007CD915 /* TextCompositionLayer.swift */; };
 		486E8922220B78FF007CD915 /* SolidCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8725220B78BF007CD915 /* SolidCompositionLayer.swift */; };
 		486E8923220B78FF007CD915 /* PreCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8726220B78BF007CD915 /* PreCompositionLayer.swift */; };
 		486E8924220B78FF007CD915 /* ImageCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8727220B78BF007CD915 /* ImageCompositionLayer.swift */; };
@@ -523,7 +520,6 @@
 		486E8993220B790E007CD915 /* PointValueProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E871E220B78BF007CD915 /* PointValueProvider.swift */; };
 		486E8994220B790E007CD915 /* CompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8722220B78BF007CD915 /* CompositionLayer.swift */; };
 		486E8995220B790E007CD915 /* NullCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8723220B78BF007CD915 /* NullCompositionLayer.swift */; };
-		486E8996220B790E007CD915 /* TextCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8724220B78BF007CD915 /* TextCompositionLayer.swift */; };
 		486E8997220B790E007CD915 /* SolidCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8725220B78BF007CD915 /* SolidCompositionLayer.swift */; };
 		486E8998220B790E007CD915 /* PreCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8726220B78BF007CD915 /* PreCompositionLayer.swift */; };
 		486E8999220B790E007CD915 /* ImageCompositionLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486E8727220B78BF007CD915 /* ImageCompositionLayer.swift */; };
@@ -673,7 +669,6 @@
 		486E871E220B78BF007CD915 /* PointValueProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointValueProvider.swift; sourceTree = "<group>"; };
 		486E8722220B78BF007CD915 /* CompositionLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompositionLayer.swift; sourceTree = "<group>"; };
 		486E8723220B78BF007CD915 /* NullCompositionLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NullCompositionLayer.swift; sourceTree = "<group>"; };
-		486E8724220B78BF007CD915 /* TextCompositionLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextCompositionLayer.swift; sourceTree = "<group>"; };
 		486E8725220B78BF007CD915 /* SolidCompositionLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SolidCompositionLayer.swift; sourceTree = "<group>"; };
 		486E8726220B78BF007CD915 /* PreCompositionLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreCompositionLayer.swift; sourceTree = "<group>"; };
 		486E8727220B78BF007CD915 /* ImageCompositionLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCompositionLayer.swift; sourceTree = "<group>"; };
@@ -991,7 +986,6 @@
 			children = (
 				486E8722220B78BF007CD915 /* CompositionLayer.swift */,
 				486E8723220B78BF007CD915 /* NullCompositionLayer.swift */,
-				486E8724220B78BF007CD915 /* TextCompositionLayer.swift */,
 				486E8725220B78BF007CD915 /* SolidCompositionLayer.swift */,
 				486E8726220B78BF007CD915 /* PreCompositionLayer.swift */,
 				486E8727220B78BF007CD915 /* ImageCompositionLayer.swift */,
@@ -1677,7 +1671,6 @@
 				486E8831220B78E4007CD915 /* CompositionLayer.swift in Sources */,
 				486E8832220B78E4007CD915 /* NullCompositionLayer.swift in Sources */,
 				25D5437422307C8B00ED90FA /* CompatibleAnimationView.swift in Sources */,
-				486E8833220B78E4007CD915 /* TextCompositionLayer.swift in Sources */,
 				486E8834220B78E4007CD915 /* SolidCompositionLayer.swift in Sources */,
 				486E8835220B78E4007CD915 /* PreCompositionLayer.swift in Sources */,
 				486E8836220B78E4007CD915 /* ImageCompositionLayer.swift in Sources */,
@@ -1795,7 +1788,6 @@
 				486E88A5220B78F4007CD915 /* PointValueProvider.swift in Sources */,
 				486E88A6220B78F4007CD915 /* CompositionLayer.swift in Sources */,
 				486E88A7220B78F4007CD915 /* NullCompositionLayer.swift in Sources */,
-				486E88A8220B78F4007CD915 /* TextCompositionLayer.swift in Sources */,
 				486E88A9220B78F4007CD915 /* SolidCompositionLayer.swift in Sources */,
 				486E88AA220B78F4007CD915 /* PreCompositionLayer.swift in Sources */,
 				486E88AB220B78F4007CD915 /* ImageCompositionLayer.swift in Sources */,
@@ -1935,7 +1927,6 @@
 				486E891F220B78FF007CD915 /* CompositionLayer.swift in Sources */,
 				486E8920220B78FF007CD915 /* NullCompositionLayer.swift in Sources */,
 				25D5437522307C8C00ED90FA /* CompatibleAnimationView.swift in Sources */,
-				486E8921220B78FF007CD915 /* TextCompositionLayer.swift in Sources */,
 				486E8922220B78FF007CD915 /* SolidCompositionLayer.swift in Sources */,
 				486E8923220B78FF007CD915 /* PreCompositionLayer.swift in Sources */,
 				486E8924220B78FF007CD915 /* ImageCompositionLayer.swift in Sources */,
@@ -2053,7 +2044,6 @@
 				486E8993220B790E007CD915 /* PointValueProvider.swift in Sources */,
 				486E8994220B790E007CD915 /* CompositionLayer.swift in Sources */,
 				486E8995220B790E007CD915 /* NullCompositionLayer.swift in Sources */,
-				486E8996220B790E007CD915 /* TextCompositionLayer.swift in Sources */,
 				486E8997220B790E007CD915 /* SolidCompositionLayer.swift in Sources */,
 				486E8998220B790E007CD915 /* PreCompositionLayer.swift in Sources */,
 				486E8999220B790E007CD915 /* ImageCompositionLayer.swift in Sources */,

@leekeunhwan
Copy link

leekeunhwan commented Jul 17, 2019

I am also experiencing same issues @alimek

RN Version: 0.59.10

<unknown>:0: error: filename "TextCompositionLayer.swift" used twice: '/Users/${userName}/${packageName}/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift' and 
'/Users/${userName}/${packageName}/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

@ashnfb
Copy link

ashnfb commented Jul 17, 2019

If use_modular_headers isn't compatible with your pod file, try use_frameworks instead

@ganoch
Copy link

ganoch commented Jul 18, 2019

I have different problem:

unknown>:0: error: filename "TextCompositionLayer.swift" used twice: 'XXX/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift' and 'XXX/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name

I have linked the ios-lottie and lottie-react-native manually

you ever fix this issue? facing the same issue

@alimek
Copy link

alimek commented Jul 18, 2019

@ganoch nope, just downgraded to 2.6.1

@ganoch
Copy link

ganoch commented Jul 18, 2019

@alimek I just deleted and removed every instance of lottie on my setup, including previous manually set up lottie libraries, then relinked and pod installed and then it worked

I think I should have removed all manual references before reinstalling the new version.

@JakeHadley
Copy link

JakeHadley commented Jul 20, 2019

@alimek What was the process you took to install 2.6.1? I had similar issues installing 3.0.x. And what version of lottie-ios did you use? And what RN version? I am getting the same issue you were with the TextCompositionLayer.swift used twice and I'm now on 2.6.1.

@LPranulis
Copy link

@pianoman730 , @alimek , @ganoch see this: #523

@ganoch
Copy link

ganoch commented Jul 30, 2019

there is definitely cache issue somewhere here, after deleting DerivedData the problem reappeared

@mateomarin
Copy link

I am currently executing the exact installation steps in the README using RN 0.60.4. Autolinking apparently does not work, because the pod paths for lottie-ios and lottie-react-native don't appear in the Podfile, so I linked them manually. Following that, I tried running react-native run-ios, but there seems to be a module map problem.. more specifically:

fatal error: module map file '...Xcode/DerivedData/.../Build/Products/Debug-iphonesimulator/lottie-ios/Lottie.modulemap' not found

What is the latest stable version of RN/Lottie-ios/Lottie-React-Native that you guys were able to make the lib work with?

@mateomarin
Copy link

mateomarin commented Jul 30, 2019

Ok. Made it work in RN 0.60.4, somehow. I don't know if it was just lucky or replicable, I've been at it for the good part of the last 7h.. I'm going to go step-by-step...

  1. yarn add lottie-react-native

  2. yarn add lottie-ios@3.0.3

  3. Copy and pasted the following lines in the Podfile (DO NOT USE react native link)
    pod 'lottie-ios', :path => '../node_modules/lottie-ios'
    pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

  4. In the XCode Project ONLY added the Lottie.xcodeproj from the node_modules/lottie into the Libraries folder - DO NOT add the node_modules/lottie-react-native xcodeproj as well as a Library, as indicated by some comments.

  5. Installed the Lottie.framework iOS as an Embedded Binary

  6. In the project's ios folder (cd ios), run pod install.

  7. react-native run-ios

Just that. Before, I tried practically every solution posted til now, including the empty swift file, bridging header, PATH and other solutions. Nothing worked. This magically did the trick. Hope it helps. Cheers.

@ganoch
Copy link

ganoch commented Aug 2, 2019

@mateomarin the "TextCompositionLayer.swift" used twice I think I solved by upgrading to lottie-ios@3.0.6, haven't really seen the issue pop since then.

OR i haven't tried it yet, but @tokinonagare's patch should work, combined with patch-packager should be enough for a short while until 3.0.6 is officially supported

EDIT: I'm currently on manual installation, because of different issues with different packages. So, I can't really tell if it works with Pods.

@tareqdayya
Copy link

Same here, stuck at pod install/build. After getting stuck the same way @pianoman730 did, I tried adding the lottie.framework to embedded binaries and I now have one error preventing me from the build:
"TextCompositionLayer.swift" used twice, which @ganoch also had, but upgrading the lottie-ios did not fix it.
I have also tried the creation of a swift file to bring forth the creation of bridging headers. I have also tried adding the paths to the Library Search Paths.
Android installs fine, but the animation never starts (it displays nothing but the last frame.)

@MaRuifeng
Copy link

I am able to get below versions to compatibly work in iOS.

  • RN: 0.60.0
  • lottie-ios: 3.0.3
  • lottie-react-native: 3.1.0,
  • Xcode: 10.3
  1. Run npm i --save lottie-react-native and npm i --save lottie-ios@3.0.3
  2. Add below pod dependencies to the Podfile under the ios folder
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
  1. Run pod install under the ios folder
  2. Add a dummy empty swift file for compilation success as suggested here
  3. Change to XCode legacy build system as suggested here

Now react-native run-ios should work with Lottie animations properly presented in the app.

@alfruiz
Copy link

alfruiz commented Aug 13, 2019

for me it was only adding the swift dummy file as @MaRuifeng told, step 4

@JimTeva
Copy link

JimTeva commented Aug 14, 2019

I guess I should mention I'm on RN 0.59, "lottie-ios": "^3.0.3", and "lottie-react-native": "^3.0.1",
I'm getting this still:

[!] CocoaPods could not find compatible versions for pod "lottie-ios":
  In Podfile:
    lottie-ios (from `../node_modules/lottie-ios`)

    lottie-react-native (from `../node_modules/lottie-react-native`) was resolved to 3.0.1, which depends on
      lottie-ios (~> 3.0.4)

I then change this
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
to
pod 'lottie-ios', '~> 3.0.4'
and get this:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. 
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), 
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Putting :modular_headers => true on pod 'lottie-react-native', :path => '../node_modules/lottie-react-native' gives the same error.
Putting use_modular_headers! at the top of the pod file, pod install runs successfully. But when I build it, I get additional errors:

Import of module 'glog.glog.log_severity' appears within namespace 'google'

I then tried what was described here and got this:

Declaration of 'RCTImageLoaderCancellationBlock' must be imported from module 'React.RCTGIFImageDecoder' before it is required

And that's where I'm stuck.

@pianoman730, Following @mynamespace advice, updating cocoapods solve the issue! Yay thanks @mynamespace

@alisherakb
Copy link

I guess I should mention I'm on RN 0.59, "lottie-ios": "^3.0.3", and "lottie-react-native": "^3.0.1",
I'm getting this still:

[!] CocoaPods could not find compatible versions for pod "lottie-ios":
  In Podfile:
    lottie-ios (from `../node_modules/lottie-ios`)

    lottie-react-native (from `../node_modules/lottie-react-native`) was resolved to 3.0.1, which depends on
      lottie-ios (~> 3.0.4)

I then change this
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
to
pod 'lottie-ios', '~> 3.0.4'
and get this:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. 
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), 
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Putting :modular_headers => true on pod 'lottie-react-native', :path => '../node_modules/lottie-react-native' gives the same error.
Putting use_modular_headers! at the top of the pod file, pod install runs successfully. But when I build it, I get additional errors:

Import of module 'glog.glog.log_severity' appears within namespace 'google'

I then tried what was described here and got this:

Declaration of 'RCTImageLoaderCancellationBlock' must be imported from module 'React.RCTGIFImageDecoder' before it is required

And that's where I'm stuck.

@pianoman730, Following @mynamespace advice, updating cocoapods solve the issue! Yay thanks @mynamespace

It doesn't in my case. Stuck on


The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. 
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), 
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.```

@JimTeva
Copy link

JimTeva commented Aug 15, 2019

Updated as of 07/10/2019
iOS install works for me with this config:

lottie-ios: 3.1.3
lottie-react-native: ^3.2.1
react: 16.9.0,
react-native: 0.61.1,

yarn add lottie-react-native
yarn add lottie-ios@3.1.3
  1. Xcode: added a new Swift file and selected yes to "add Brigde header" in the project folder (creates two new files: newFile.swift and xxx-Bridging-header.h)
  2. Updated cocoapods
  3. Clean DerivedData, clean ios/build
  4. In ios folder: pod install

(no modification in Podfile)

@samitha9125
Copy link

I guess I should mention I'm on RN 0.59, "lottie-ios": "^3.0.3", and "lottie-react-native": "^3.0.1",
I'm getting this still:

[!] CocoaPods could not find compatible versions for pod "lottie-ios":
  In Podfile:
    lottie-ios (from `../node_modules/lottie-ios`)

    lottie-react-native (from `../node_modules/lottie-react-native`) was resolved to 3.0.1, which depends on
      lottie-ios (~> 3.0.4)

I then change this
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
to
pod 'lottie-ios', '~> 3.0.4'
and get this:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. 
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), 
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Putting :modular_headers => true on pod 'lottie-react-native', :path => '../node_modules/lottie-react-native' gives the same error.
Putting use_modular_headers! at the top of the pod file, pod install runs successfully. But when I build it, I get additional errors:

Import of module 'glog.glog.log_severity' appears within namespace 'google'

I then tried what was described here and got this:

Declaration of 'RCTImageLoaderCancellationBlock' must be imported from module 'React.RCTGIFImageDecoder' before it is required

And that's where I'm stuck.

@pianoman730, Following @mynamespace advice, updating cocoapods solve the issue! Yay thanks @mynamespace

It doesn't in my case. Stuck on


The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. 
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), 
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.```

Same here. Still same error occurs even after updating cocoapods to 1.7.5. Did you find a solution?

@adamivancza
Copy link

adamivancza commented Sep 6, 2019

I was able to make it work using patch-package lib. I've patched the xcodeproj file:

install the patch-package lib to dev dependencies: npm i patch-package --save-dev or yarn add patch-package postinstall-postinstall --dev

edit your package.json file and add patch-package to postinstall:
"scripts": { "postinstall": "patch-package" }

create a patches folder, and create an empty file in it called 'lottie-ios+3.0.3.patch' and copy paste this: https://gist.github.com/adamivancza/bc75187ad4d11f1275020c6b4051316c

now when you run npm or yarn install you should see a following message:
patch-package 6.1.2
Applying patches...
lottie-ios@3.0.3 ✔

@calix
Copy link

calix commented Sep 17, 2019

Creating the bridge header file solved the issue for me.

@MacKentoch
Copy link

MacKentoch commented Sep 21, 2019

iOS install works for me with this config:

lottie-ios: 3.0.3
lottie-react-native: ^3.1.0
react: 16.8.6,
react-native: 0.60.4,

yarn add lottie-react-native
yarn add lottie-ios@3.0.3
  1. Xcode: added a new Swift file and a Brigde header in the project folder
  2. Updated cocoapods
  3. In ios folder: pod install

(no modification in Podfile)

NOTE: creating bridging header easy and fast way:

  • in xcode: add new file -> add new Swift file and name it anything you want like for example dummy.swift.
  • then valid and xcode will ask you wether you want to create a bridging-header file. Say yes.
  • you can remove all swift code from dummy.swift (even import) but don't delete the file (otherwise it won't compile)

@mehrankhandev
Copy link

lottie-ios: 3.0.3
lottie-react-native: ^3.1.0
react: 16.8.6,
react-native: 0.60.4,

First Update cocoapods with command

sudo gem install cocoapods

Then following Error coming

"NameError - uninitialized constant Concurrent::Promises"

Fix with link . Run Command

sudo gem install concurrent-ruby

Then following errors are coming

ld: directory not found for option '-L/Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/ios/build/dsPlayground/Build/Products/Debug-iphonesimulator/React'
⚠️  ld: directory not found for option '-L/Users/lyqht/Documents/react-native-mol-design-system/dsPlayground/ios/build/dsPlayground/Build/Products/Debug-iphonesimulator/yoga'
⚠️  ld: Could not find auto-linked library 'swiftCoreFoundation'
⚠️  ld: Could not find auto-linked library 'swiftQuartzCore'
⚠️  ld: Could not find auto-linked library 'swiftCore'
⚠️  ld: Could not find auto-linked library 'swiftCoreGraphics'
⚠️  ld: Could not find auto-linked library 'swiftObjectiveC'
⚠️  ld: Could not find auto-linked library 'swiftDispatch'
⚠️  ld: Could not find auto-linked library 'swiftSwiftOnoneSupport'
⚠️  ld: Could not find auto-linked library 'swiftDarwin'
⚠️  ld: Could not find auto-linked library 'swiftUIKit'
⚠️  ld: Could not find auto-linked library 'swiftCoreImage'
⚠️  ld: Could not find auto-linked library 'swiftFoundation'
⚠️  ld: Could not find auto-linked library 'swiftMetal'
⚠️  ld: Could not find auto-linked library 'swiftCoreLocation'

Fix by adding "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)" to the library search paths of your target , See link

@mobigaurav
Copy link

Had the same issue, Problem got resolved when I ran the command

  1. pod repo update
  2. pod install in iOS folder

lottie

@schumannd
Copy link

what solved a similar error for me was creating an empty swift file in xcode

@seblau
Copy link
Contributor

seblau commented Dec 4, 2019

I guess I should mention I'm on RN 0.59, "lottie-ios": "^3.0.3", and "lottie-react-native": "^3.0.1",
I'm getting this still:

[!] CocoaPods could not find compatible versions for pod "lottie-ios":
  In Podfile:
    lottie-ios (from `../node_modules/lottie-ios`)

    lottie-react-native (from `../node_modules/lottie-react-native`) was resolved to 3.0.1, which depends on
      lottie-ios (~> 3.0.4)

I then change this
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
to
pod 'lottie-ios', '~> 3.0.4'
and get this:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `lottie-react-native` depends upon `React`, which does not define modules. 
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), 
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Putting :modular_headers => true on pod 'lottie-react-native', :path => '../node_modules/lottie-react-native' gives the same error.
Putting use_modular_headers! at the top of the pod file, pod install runs successfully. But when I build it, I get additional errors:

Import of module 'glog.glog.log_severity' appears within namespace 'google'

I then tried what was described here and got this:

Declaration of 'RCTImageLoaderCancellationBlock' must be imported from module 'React.RCTGIFImageDecoder' before it is required

And that's where I'm stuck.

@JakeHadley: I am getting the same issue, see: react-native-maps/react-native-maps#3209

@louisraetz
Copy link

If use_modular_headers isn't compatible with your pod file, try use_frameworks instead

thanks bud, works perfectly now

@pvanny1124
Copy link

Adding use_modular_headers! to the podfile allows the pods to be installed correctly. Thanks again @mysport12

this worked for me, thanks!

@Navicna
Copy link

Navicna commented Jul 24, 2020

Updating lottie solved for me.

@prog-24
Copy link

prog-24 commented Oct 5, 2020

Upgrading xCode always seem to throw ten spanners in the works. Tried everything here to no avail, anyone with any other ideas. I am stuck.

@emilioicai
Copy link
Member

I'm closing this as a version update should solve this issue.

@flikQ
Copy link

flikQ commented May 4, 2021

I'm closing this as a version update should solve this issue.

Which version of which library should solve this?

@emilioicai
Copy link
Member

lottie-react-native 4.0.2

@flikQ
Copy link

flikQ commented May 4, 2021

lottie-react-native 4.0.2

I am using that version and still getting the following:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `lottie-react-native` depends upon `React-Core`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

@ali14a
Copy link

ali14a commented May 6, 2021

Getting same error for
"lottie-ios": "3.1.8",
"lottie-react-native": "^4.0.2",

@ali14a
Copy link

ali14a commented May 6, 2021

it got fixed using facebook/react-native#26217 (comment)

@Bournegit
Copy link

Getting this error on version V4.0.2
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod lottie-react-native depends upon React-Core, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

Any help.

@austinGENEreeve
Copy link

austinGENEreeve commented Jul 17, 2021

Getting this error on version V4.0.2
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod lottie-react-native depends upon React-Core, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

Any help.

I got this same error and was able to solve it by updating my project from react native v0.63.2 to v0.64.2.

@AkshayAdiga1997
Copy link

Works fine with

"react": "17.0.1",
"react-native": "0.64.2",
"lottie-ios": "3.1.8",
"lottie-react-native": "^3.1.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests