[已解决] IOS Command PhaseScriptExecution failed with a nonzero exit code

../../flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_verification_box-2.0.0/lib/src/verification_box.dart:196:9: Error: The method 'WhitelistingTextInputFormatter' isn't defined for the class '_VerificationBox'.
 - '_VerificationBox' is from 'package:flutter_verification_box/src/verification_box.dart' ('../../flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_verification_box-2.0.0/lib/src/verification_box.dart').
Try correcting the name to the name of an existing method, or defining a method named 'WhitelistingTextInputFormatter'.
        WhitelistingTextInputFormatter(RegExp("[0-9]")),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed to package /Users/imac/XXX/XXX(项目路径).
Command PhaseScriptExecution failed with a nonzero exit code
  • 网上的解决方式:(不过,我试了好几次都没用...)
    截屏2022-03-03 下午1.51.05.png

解决方案:

只需更改 WhitelistingTextInputFormatterFilteringTextInputFormatter 原文

image.png

大概意思是我用的第三方插件使用的一个方法是已经被放弃(已经删掉了)了,所以我们更改插件里面的那个方法就可以(进入插件里面报错的代码里)

....
 inputFormatters: [
        // WhitelistingTextInputFormatter(RegExp("[0-9]")),//直接删掉这行
        FilteringTextInputFormatter.digitsOnly, //添加这个
      ],
...

最后,希望对你有帮助;现在flutter版本更新的有点快,偶尔他们会直接删掉有些类;所以偶尔出现这种坑;反正仔细查看编译失败的地方就会有答案;

你可能感兴趣的:([已解决] IOS Command PhaseScriptExecution failed with a nonzero exit code)