CameronStuartSmith / flutter_lottie

Use lottie in flutter for both iOS and Android
Apache License 2.0
158 stars 75 forks source link

No podspec found for `mark922_flutter_lottie` in `.symlinks/plugins/mark922_flutter_lottie/ios` #19

Open kaina404 opened 4 years ago

kaina404 commented 4 years ago

mark922_flutter_lottie: ^0.2.1

ERR0R on ios


 -> Fetching podspec for `mark922_flutter_lottie` from `.symlinks/plugins/mark922_flutter_lottie/ios`
    [!] No podspec found for `mark922_flutter_lottie` in `.symlinks/plugins/mark922_flutter_lottie/ios`

..........

Finished with error: Error running pod install
arctouch-matheusromao commented 4 years ago

Hey @CameronStuartSmith and @kaina404

This problem is happening here too and the reason for that is the plugin name. When you add the plugin in the Flutter project, it has the mark922_flutter_lottie name. Then, when you try to build the iOS project, Flutter looks for the .podspec of the Plugin inside the following path: flutter/⁨.pub-cache⁩/hosted⁩/⁨pub.dartlang.org/mark922_flutter_lottie-0.2.1/ios. If you check, the .podspec is there but with a different name, thus Flutter is not able to find the file and this error is thrown.

Follow the steps to fix:

  1. Change the .podspec name in the path above to mark922_flutter_lottie.podspec
  2. Inside the .podspec, change the s.name value to mark922_flutter_lottie
  3. In the same path, open Classes/FlutterLottiePlugin.m and change the second import: From:
    #import "FlutterLottiePlugin.h"
    #import <flutter_lottie/flutter_lottie-Swift.h>

To:

#import "FlutterLottiePlugin.h"
#import <mark922_flutter_lottie/mark922_flutter_lottie-Swift.h>

⁩4. Have fun using Lottie for iOS

EDIT

You still need to update your Info.plist to support iOS View Embedding:

<key>io.flutter.embedded_views_preview</key>
<true/>
mark922 commented 4 years ago

@arctouch-matheusromao Thanks for pointing it out. Repo updated.