1

请知道它flutter build ios可以完美运行,没有任何警告或错误。

但是当我这样做时flutter build ios --obfuscate --split-debug-info=/_app/obfuscate

它因此错误而失败:

Building com.x.app for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: YSHDK23K

Running pod install...                                             18.9s 
Running Xcode build...                                                   
                                                    
Xcode build done.                                           515.9s 
Failed to build iOS app 
Error output from Xcode build: 
↳ 
    ** BUILD FAILED ** 


Xcode's output: 
↳ 
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1462:38: warning: 
    variable 'sum_left' may be uninitialized when used here [-Wconditional-uninitialized] 
        const uint16x8_t sum = vaddq_u16(sum_left, sum_top); 
                                         ^~~~~~~~ 
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1426:3: note: variable 
    'sum_left' is declared here 
      uint16x8_t sum_left; 
      ^ 
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1462:48: warning: 
    variable 'sum_top' may be uninitialized when used here [-Wconditional-uninitialized] 
        const uint16x8_t sum = vaddq_u16(sum_left, sum_top); 
                                                   ^~~~~~~ 
   /_app/ios/Pods/libwebp/src/dsp/dec_neon.c:1425:3: note: variable 
    'sum_top' is declared here 
      uint16x8_t sum_top; 
      
    ...... ======= <Warnings Truncated> ========= .......

    /Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_image_compress-0.6.5+1/ios/Classes/SYP 
    ictureMetadata/SYMetadataExif.m:9:9: warning: non-portable path to file '"SYMetadataExif.h"'; specified path differs in 
    case from file name on disk [-Wnonportable-include-path] 
    #import "SYMetadataEXIF.h" 
            ^~~~~~~~~~~~~~~~~~ 
            "SYMetadataExif.h" 
    1 warning 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 

Encountered error while building for device. 

我从 Stackoverflow 收到一个错误,因此无法在不截断警告的情况下提交,因此我在中间将其切断。如果您需要更多这些警告,请询问我,我会将其发送给您。

我在这里想念什么?即使在发布模式下,该应用程序也能正常工作。只有当我添加--obfuscate标志时它是这样的。

4

2 回答 2

1

最后我解决了这个问题。但是解决方案很乏味,我不确定这是否是最好的解决方案。但我认为这是一个强大的解决方案:

  1. 从您的计算机中完全删除 Flutter
  2. 使用最新版本重新安装颤振。
  3. 在项目目录的 ios 文件夹中,删除“Podfile”文件、“Podfile.lock”文件和“Pods”目录。
  4. 在您flutter clean的项目目录中执行。
  5. 然后按预期重新运行应用程序。

然后它起作用了……至少对我来说。

其他人有其他解决方案吗?

于 2020-07-02T07:36:26.933 回答
0

清除所有不需要的文件,从终端运行此命令

flutter clean && rm ios/Podfile ios/Podfile.lock pubspec.lock && rm -rf ios/Pods ios/Runner.xcworkspace

于 2020-09-14T09:08:30.577 回答