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

Open
cheeaun opened this issue Jul 4, 2019 · 41 comments

Comments

@cheeaun
Copy link

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

This comment has been minimized.

Copy link

commented Jul 4, 2019

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-community/react-native-maps#2940

@emilioicai

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

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

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

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

This comment has been minimized.

Copy link

commented Jul 10, 2019

@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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 10, 2019

@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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 11, 2019

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

@lyqht

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 12, 2019

@lyqht same issue

@xks19943

This comment has been minimized.

Copy link

commented Jul 12, 2019

@lyqht How do you solve this problem? tanks

@xks19943

This comment has been minimized.

@emilioicai

This comment has been minimized.

Copy link
Member

commented Jul 13, 2019

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

This comment has been minimized.

Copy link

commented Jul 13, 2019

@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

@pianoman730

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 17, 2019

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

@ganoch

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 18, 2019

@ganoch nope, just downgraded to 2.6.1

@ganoch

This comment has been minimized.

Copy link

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.

@pianoman730

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jul 23, 2019

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

@ganoch

This comment has been minimized.

Copy link

commented Jul 30, 2019

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

@mateomarin

This comment has been minimized.

Copy link

commented Jul 30, 2019

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 5, 2019

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.)

@ganoch

This comment has been minimized.

Copy link

commented Aug 6, 2019

@tareqdayya how did you update to 3.0.6? I had to use github source because 3.0.6 was not on npmjs

...
    "lottie-ios": "github:airbnb/lottie-ios#3.0.6",
...
@tareqdayya

This comment has been minimized.

Copy link

commented Aug 6, 2019

@ganoch When I didn't find it, I upgraded to the latest. I have just tried what you did as well and problem is still there.

@mynamespace

This comment has been minimized.

Copy link

commented Aug 7, 2019

I don't know if it's a coincidence, but the "CocoaPods could not find compatible versions for pod "lottie-ios"" error is gone updating cocoapods... seems like I had an old version.
sudo gem install cocoapods

@rodrigowpl

This comment has been minimized.

Copy link

commented Aug 8, 2019

Same issue here

issue when run pod install

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

The Swift pod `lottie-react-native` depends upon `React-Core`, `React-DevSupport`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTSettings`, `React-RCTText`, `React-RCTVibration`, `React-RCTWebSocket`, `Folly`, `React-cxxreact`, `React-jsiexecutor`, `yoga`, `React-fishhook`, `DoubleConversion`, `glog`, `React-jsinspector`, and `React-jsi`, which do 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.

Lottie Infos

lottie-ios": "^3.0.3",
lottie-react-native": "^3.1.0",

Infos

System:
    OS: macOS 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 786.64 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.12.0 - /usr/local/bin/node
    Yarn: 1.17.3 - ~/.yarn/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.2, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
      System Images: android-25 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom_64, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.4 => 0.60.4 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7

My podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'mereomob' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for mereomob
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_native_modules!

end

Any idea? thanks

@rodrigowpl

This comment has been minimized.

Copy link

commented Aug 9, 2019

Update: I've just updated cocoapods and works normally, as @mynamespace said

@nartjie101

This comment has been minimized.

Copy link

commented Aug 11, 2019

I don't know if it's a coincidence, but the "CocoaPods could not find compatible versions for pod "lottie-ios"" error is gone updating cocoapods... seems like I had an old version.
sudo gem install cocoapods

It worked. Thanks :)

@tareqdayya

This comment has been minimized.

Copy link

commented Aug 12, 2019

I can confirm that updating CocoaPods made the issue that arises during the pod install phase disappear.
I only had to create a bridging header file afterwards to get everything to work.

@MaRuifeng

This comment has been minimized.

Copy link

commented Aug 13, 2019

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

This comment has been minimized.

Copy link

commented Aug 13, 2019

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

@JimTeva

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

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

This comment has been minimized.

Copy link

commented Aug 15, 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.