skip to Main Content

Recently bought a Macbook air M2 for Flutter development. Android app launching correctly on the Android simulator but having a lot of difficulties getting ios app to work.

The counter example project is working on the ios simulator but not my project. I am wondering if perhaps this is due to Firebase or the fact I cloned the flutter project from Windows. Podfile and info.plist included below.

Launching lib/main.dart on iPhone 12 in debug mode...
    Running pod install...                                             13.3s
    Running Xcode build...                                                  
    Xcode build done.                                           192.9s
    Failed to build iOS app
    Error output from Xcode build:
    ↳
        2022-08-23 10:54:07.757 xcodebuild[44481:4428285] Requested but did not find
        extension point with identifier
        Xcode.IDEKit.ExtensionSentinelHostApplications for extension
        Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in
        com.apple.dt.IDEWatchSupportCore
        2022-08-23 10:54:07.757 xcodebuild[44481:4428285] Requested but did not find
        extension point with identifier
        Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension
        Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of
        plug-in com.apple.dt.IDEWatchSupportCore
        2022-08-23 10:55:05.182 xcodebuild[44481:4428321]
        /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-20504/XCSo
        urceControl/Service/XCSourceControlXPCServiceClient.swift:
        'com.apple.dt.GitHubHostBuiltInExtension' XPC connection interrupted:
        <NSXPCConnection: 0x600001f22120> connection to service named
        com.apple.dt.GitHubHostBuiltInExtension
        ** BUILD FAILED **
    
    
    Xcode's output:
    ↳
        Writing result bundle at path:
            /var/folders/_b/h3qp3_6d675d938v23_ns4_80000gn/T/flutter_tools.7l9oeA/flutt
            er_ios_build_temp_dir6UlSvA/temporary_xcresult_bundle
    
        Command CompileSwiftSources failed with a nonzero exit code
        Command CompileSwiftSources failed with a nonzero exit code
        Command CompileSwiftSources failed with a nonzero exit code
        error: emit-module command failed with exit code 1 (use -v to see
        invocation)
        <module-includes>:1:9: note: in file included from <module-includes>:1:
        #import "Headers/FirebaseCoreExtension-umbrella.h"
                ^
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FirebaseCoreExtension-umbrella.h:13
        :9: note: in file included from
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FirebaseCoreExtension-umbrella.h:13
        :
        #import "FIRAppInternal.h"
                ^
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FIRAppInternal.h:17:9: error:
        include of non-modular header inside framework module
        'FirebaseCoreExtension.FIRAppInternal':
        '/Users/jarjar/project1/ios/Pods/Headers/Public/FirebaseCore/FIRApp.h'
        #import <FirebaseCore/FIRApp.h>
                ^
        /Users/jarjar/project1/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Stor
        age.swift:23:29: error: could not build Objective-C module
        'FirebaseCoreExtension'
        @_implementationOnly import FirebaseCoreExtension
                                    ^
        <module-includes>:1:9: note: in file included from <module-includes>:1:
        #import "Headers/FirebaseCoreExtension-umbrella.h"
                ^
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FirebaseCoreExtension-umbrella.h:13
        :9: note: in file included from
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FirebaseCoreExtension-umbrella.h:13
        :
        #import "FIRAppInternal.h"
                ^
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FIRAppInternal.h:17:9: error:
        include of non-modular header inside framework module
        'FirebaseCoreExtension.FIRAppInternal':
        '/Users/jarjar/project1/ios/Pods/Headers/Public/FirebaseCore/FIRApp.h'
        #import <FirebaseCore/FIRApp.h>
                ^
        /Users/jarjar/project1/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Stor
        age.swift:23:29: error: could not build Objective-C module
        'FirebaseCoreExtension'
        @_implementationOnly import FirebaseCoreExtension
                                    ^
        <module-includes>:1:9: note: in file included from <module-includes>:1:
        #import "Headers/FirebaseCoreExtension-umbrella.h"
                ^
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FirebaseCoreExtension-umbrella.h:13
        :9: note: in file included from
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FirebaseCoreExtension-umbrella.h:13
        :
        #import "FIRAppInternal.h"
                ^
        /Users/jarjar/project1/build/ios/Debug-iphonesimulator/FirebaseCoreExtension
        /FirebaseCoreExtension.framework/Headers/FIRAppInternal.h:17:9: error:
        include of non-modular header inside framework module
        'FirebaseCoreExtension.FIRAppInternal':
        '/Users/jarjar/project1/ios/Pods/Headers/Public/FirebaseCore/FIRApp.h'
        #import <FirebaseCore/FIRApp.h>
                ^
     ...
    
    
    Swift Compiler Error (Xcode): Could not build Objective-C module
    'FirebaseCoreExtension'
    /Users/jarjar/project1/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.
    swift:22:28
    
    
    Uncategorized (Xcode): Command EmitSwiftModule failed with a nonzero exit code
    
    
    Could not build the application for the simulator.
    Error launching application on iPhone 12.

Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '10.0'

use_modular_headers!
# Add the Firebase pod for Google Analytics


pod 'FirebaseAnalytics'

# For Analytics without IDFA collection capability, use this pod instead
# pod 'Firebase/AnalyticsWithoutAdIdSupport'

# Add the pods for any other Firebase products you want to use in your app
# For example, to use Firebase Authentication and Cloud Firestore
pod 'FirebaseAuth'
pod 'FirebaseFirestore'
pod 'Firebase'
pod 'FirebaseCoreInternal'
pod 'GoogleUtilities'

# 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)

    # Start of the permission_handler configuration
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'

      # You can enable the permissions needed here. For example to enable camera
      # permission, just remove the `#` character in front so it looks like this:
      #
      # ## dart: PermissionGroup.camera
      # 'PERMISSION_CAMERA=1'
      #
      #  Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',

        ## dart: PermissionGroup.calendar
        # 'PERMISSION_EVENTS=1',

        ## dart: PermissionGroup.reminders
        # 'PERMISSION_REMINDERS=1',

        ## dart: PermissionGroup.contacts
        # 'PERMISSION_CONTACTS=1',

        ## dart: PermissionGroup.camera
        'PERMISSION_CAMERA=1',

        ## dart: PermissionGroup.microphone
        'PERMISSION_MICROPHONE=1',

        ## dart: PermissionGroup.speech
        # 'PERMISSION_SPEECH_RECOGNIZER=1',

        ## dart: PermissionGroup.photos
        'PERMISSION_PHOTOS=1',

        ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
        # 'PERMISSION_LOCATION=1',

        ## dart: PermissionGroup.notification
        # 'PERMISSION_NOTIFICATIONS=1',

        ## dart: PermissionGroup.mediaLibrary
        'PERMISSION_MEDIA_LIBRARY=1',

        ## dart: PermissionGroup.sensors
        # 'PERMISSION_SENSORS=1',   

        ## dart: PermissionGroup.bluetooth
        # 'PERMISSION_BLUETOOTH=1',

        ## dart: PermissionGroup.appTrackingTransparency
        # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',

        ## dart: PermissionGroup.criticalAlerts
        # 'PERMISSION_CRITICAL_ALERTS=1'
      ]

    end 
    # End of the permission_handler configuration

  end
end

Info.plist :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>project1</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>project1</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    <key>UIBackgroundModes</key>
    <array>
        <string>audio</string>
    </array>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>https</string>
        <string>http</string>
    </array>
    <key>NSCameraUsageDescription</key>
    <string>Share photos and add profile images</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Create audio to be shared with other app users</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Share photos and add profile images</string>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>CADisableMinimumFrameDurationOnPhone</key>
    <true/>
</dict>
</plist>

2

Answers


  1. Chosen as BEST ANSWER

    After much hair pulling, I managed to get the ios app to build by creating a new Flutter project and transferring over my Lib folder.

    I also double-checked all the necessary Podfile and Info.plist requirements from my packages but I don't believe this was the issue as I tried going back to my original project and replacing them with the new ones but still no go. Error must be elsewhere.

    My advice to anyone else who encounters this would be to not waste your time and instead build a new Flutter project and replace the code with that from your old Lib folder (modify the Android and ios folders as needed by your packages also of course - AndroidManifest, build.gradle, podfile, info.plist, etc.). Good luck!


  2. Recently I had similar issues.

    First I removed all the pods for any Firebase products in the Podfile, because it’s actually not necessary to list them in the Podfile.
    And after some more hours of trying to fix this, I managed it finally by upgrading my Firebase Storage version to a higher one. In my case this was an upgrade from version 8.1.3 to 10.3.0.
    Due to version conflicts I also had to upgrade almost all other Firebase dependencies.

    My guess is that there was some corrupt pub-cache data.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search