flutter, `get_ip` does not specify a Swift version and none of the targets (`Runner`) integrating...

`get_ip` does not specify a Swift version and none of the targets (`Runner`) integrating it have
    the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in
    at least one of the targets that integrate this pod.

或者

`xxx` does not specify a Swift version and none of the targets (`Runner`) integrating it have
    the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in
    at least one of the targets that integrate this pod.


在pod install时,项目中引用到的get_ip库(或者其他的库xxx表示),报了以上的错误,意思是说这个库使用的swift版本跟主项目的不一致。解决方法如下:

复制这个库(例如get_ip)的代码,重新新建flutter项目,将代码复制到新的项目里面,再上传到公司的git仓库中,打tag,再依赖,再去pod install,即可。

flutter, `get_ip` does not specify a Swift version and none of the targets (`Runner`) integrating...flutter, `get_ip` does not specify a Swift version and none of the targets (`Runner`) integrating...

 git tag -a 0.0.1 -m "改写get_ip库..."

git push --tags

flutter, `get_ip` does not specify a Swift version and none of the targets (`Runner`) integrating...

总结一下,pub中的库有很多,但是经常会有flutter的版本和java/kotlin、objectC/Swift的版本冲突和不兼容的情况出现,特别是在flutter混合开发(原生项目和flutter混合的项目)的过程中会出现类似这种不兼容的情况,完全可以自己动手去改写这些pub库,不要认为很难,动手去做就完了。