Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

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,不知道怎么解决。。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...