is there a way to exclude a package from iOS in flutter?

Viewed 2187

I am making use of the package "sms_maintained" which is only available for Android.

However, the project needs an iOS version and what I am doing currently is to remove the package when developing for iOS.

How can I keep the package in the pubspec.yaml file but disable iOS from checking into the package? The goal is to have a uniform codebase.

I have tried to exclude the package in the Podfile using

skip_line_start_symbols = ["#", "/","sms_maintained"]

which skips the package but during build a reference is made to GeneratedPluginRegistrant which is auto generated.

Any help will be appreciated, thanks.

2 Answers

So I found a solution to the problem, the sms_maintained package indeed has a podspec file named sms.podspec in the ios/.symlinks/plugins which should be renamed to sms_maintained.podspec.

Also open the file and rename sms in the s.name key to sms_maintained

Rerun the app

Related