skip to Main Content

My App has was working and was going to release for Android and iOS, but few days ago after I update to Flutter 2.0 and XCode 12.5 "flutter run" fails in iOS only.
I downgraded XCode to 12.4 also still not working.

Development: Shivam Srivastava (67UX3WD5D5)"
Running pod install...                                              7.8s
Running Xcode build...                                                  
Xcode build done.                                           88.3s
Failed to build iOS app
Error output from Xcode build:
↳
    2021-06-11 16:26:19.761 xcodebuild[968:9748]
    CFURLRequestSetHTTPCookieStorageAcceptPolicy_block_invoke: no longer
    implemented and should not be called
    ** BUILD FAILED **


Xcode's output:
↳
    lib/widgets/PdfRender.dart:14:8: Error: Error when reading
    '../../../flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.11/lib/p
    df_render_widgets2.dart': No such file or directory
    import 'package:pdf_render/pdf_render_widgets2.dart';

2

Answers


  1. run pod update that worked for me there are packages that need to be updated.
    the same thing happened my app was not building i run flutter clean then flutter pub get then pod update that solved it for me.

    Login or Signup to reply.
  2. My pod file looks like this and works perfectly

    # Uncomment this line to define a global platform for your project
    platform :ios, '12'
    
    # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
    ENV['COCOAPODS_DISABLE_STATS'] = 'true'
    
    project 'Runner', {
      'Debug' => :debug,
      'Profile' => :release,
      'Release' => :release,
    }
    
    def flutter_root
      generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
      unless File.exist?(generated_xcode_build_settings_path)
        raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
      end
    
      File.foreach(generated_xcode_build_settings_path) do |line|
        matches = line.match(/FLUTTER_ROOT=(.*)/)
        return matches[1].strip if matches
      end
      raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
    end
    
    require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
    
    flutter_ios_podfile_setup
    
    target 'Runner' do
      use_frameworks!
      use_modular_headers!
    
      flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
    end
    
    post_install do |installer|
     installer.pods_project.targets.each do |target|
       flutter_additional_ios_build_settings(target)
       target.build_configurations.each do |config|
         config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.3'
         config.build_settings['ENABLE_BITCODE'] = 'YES'
         config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
                 '$(inherited)',
         # dart: PermissionGroup.camera
         'PERMISSION_CAMERA=1',
    
         # dart: PermissionGroup.microphone
         'PERMISSION_MICROPHONE=1',
    
         # dart: PermissionGroup.photos
         'PERMISSION_PHOTOS=1',
    
         # dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
         'PERMISSION_LOCATION=1',
    
         # dart: PermissionGroup.notification
         'PERMISSION_NOTIFICATIONS=1',
    
         ]
       end
       installer.pods_project.build_configurations.each do |config|
           config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
       end
     end
    end
    
    
    # target 'ImageNotification' do
    #   use_frameworks!
    #
    #   pod 'Firebase/Messaging'
    # end
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search