flutter项目运行报错"variable 'originRect' is used"
Running pod install... 1.5s
Running Xcode build...
Xcode build done. 4.9s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:11: warning: variable
'originRect' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:40:26: note: uninitialized
use occurs here
atSource:originRect];
^~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:7: note: remove the 'if'
if its condition is always true
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:11: warning: variable
'originRect' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:40:26: note: uninitialized
use occurs here
atSource:originRect];
^~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:11: note: remove the '&&'
if its condition is always true
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:11: warning: variable
'originRect' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:40:26: note: uninitialized
use occurs here
atSource:originRect];
^~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:11: note: remove the '&&'
if its condition is always true
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:11: warning: variable
'originRect' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:40:26: note: uninitialized
use occurs here
atSource:originRect];
^~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:33:11: note: remove the '&&'
if its condition is always true
if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) {
^~~~~~~~~~~~~~~~~
/Users/leo/Code/flutter/.pub-cache/hosted/pub.flutter-io.cn/share-0.5.3/ios/Classes/SharePlugin.m:32:7: note: variable
'originRect' is declared here
CGRect originRect;
^
4 warnings generated.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment
target versions is 9.0 to 14.3.99. (in target 'url_launcher' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment
target versions is 9.0 to 14.3.99. (in target 'shared_preferences' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment
target versions is 9.0 to 14.3.99. (in target 'share' from project 'Pods')
warning: None of the architectures in ARCHS (x86_64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to
include at least one value from VALID_ARCHS (arm64, arm64e, armv7, armv7s). (in target 'Runner' from project 'Runner')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment
target versions is 9.0 to 14.3.99. (in target 'Flutter' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
运行的项目是:
https://github.com/2d-inc/His...
ide: vscode
device: ios 模拟器
新手学flutter,不知道怎么解决。。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论