How come flutter build ios –obfuscate –split-debug-info= failed with warnings, but flutter build ios works?

Issue

Please know that flutter build ios works perfectly without any warning or error.

But when I do flutter build ios --obfuscate --split-debug-info=/_app/obfuscate

it failed with this error :

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. 

I got an error from Stackoverflow thus cannot submit without truncating the warnings, thus I cut it off in the middle. If you need more of those warnings please ask me and I will send it to you..

What am I missing here? The app and all works fine even in release mode. It is only when I add the --obfuscate flag it is like this.

Solution

Finally I solved this problem. But the solution is tedious and I’m not sure if this is the best solution. But I think this is the robust solution:

  1. Delete Flutter entirely from your computer
  2. Reinstall flutter with the latest version.
  3. In the ios folder of your project directory, delete "Podfile" file, "Podfile.lock" file, and "Pods" directory.
  4. Do flutter clean in your project directory.
  5. Then rerun the app as intended.

Then it works… at least for me.

Anyone else has other solution?

Answered By – Zenko

Answer Checked By – Marilyn (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *