Joseph Arriaza
Joseph Arriaza

Reputation: 13784

Not able to run flutter application on iOS getting CFBundleIdentifier does not exist

I am new on the iOS world and I am getting issues that I don't understand, I am getting these console issues:

Launching lib/main.dart on iPhone XR in debug mode...
2019-03-05 23:31:46.514 defaults[19744:111480] 
The domain/default pair of (/Users/josepharriaza/Desktop/Systems/tagueoflutter/ios/Runner/Info, CFBundleIdentifier) does not exist
Xcode build done.                                           206.2s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    === BUILD TARGET firebase_messaging OF PROJECT Pods WITH CONFIGURATION Debug ===
    While building module 'TwitterKit' imported from /Users/josepharriaza/Desktop/jarriaza/Instaladores/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_twitter_login-1.1.0/ios/Classes/TwitterLoginPlugin.m:2:
    In file included from <module-includes>:1:
    In file included from /Users/josepharriaza/Desktop/Systems/tagueoflutter/ios/Pods/TwitterKit/iOS/TwitterKit.framework/Headers/TwitterKit.h:19:
    In file included from /Users/josepharriaza/Desktop/Systems/tagueoflutter/ios/Pods/TwitterKit/iOS/TwitterKit.framework/Headers/Twitter.h:8:
    /Users/josepharriaza/Desktop/Systems/tagueoflutter/ios/Pods/TwitterKit/iOS/TwitterKit.framework/Headers/TWTRAPIClient.h:67:12: warning: parameter 'response' not found in the function declaration [-Wdocumentation]
     *  @param response Metadata associated with the response to a URL load request.
               ^~~~~~~~
    /Users/josepharriaza/Desktop/Systems/tagueoflutter/ios/Pods/TwitterKit/iOS/TwitterKit.framework/Headers/TWTRAPIClient.h:132:12: warning: parameter 'URL' not found in the function declaration [-Wdocumentation]
     *  ...
                                                          ^
    2 warnings generated.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    error: couldn't parse contents of '/Users/josepharriaza/Desktop/Systems/tagueoflutter/ios/Runner/Info.plist': The data couldn’t be read because it isn’t in the correct format.
Could not build the application for the simulator.
Error launching application on iPhone XR.
Exited (sigterm)

This is my pod file:

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

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  #use_frameworks!

  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

This is my 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>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>com.archangelsystems.tagueo</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>tagueo</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>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UISupportedInterfaceOrientations</key>
    <key>NSPhotoLibraryUsageDescription</key>
    <key>NSCameraUsageDescription</key>
    <string>Tagueo necesita usar la camara</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Tagueo necesita usar el microfono</string>
    <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>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <!-- TODO Replace this value: -->
                <!-- Copied from GoogleServices-Info.plist key REVERSED_CLIENT_ID -->
                <string>com.googleusercontent.apps.1003547207636-vunn792g2i81bnb9cusbsiqpm9r816nh</string>
            </array>
        </dict>
    </array>
</dict>
</plist>

I am getting issues that indicate that the application could not be launched on the iOS device, I am trying to launch that within an iPhone XR, as I mentioned, I am new here, and I don't get solutions, I read some posts that mentioned that I had to comment use_frameworks!, but that doens't work, I read some others that indicates that I had to uncomment user_frameworks, but that neither works. So, I am kind of lost. By the way, pod install works correctly. And sometimes I only get CFBundleIdentifier) does not exist but it doe

Upvotes: 3

Views: 3531

Answers (1)

JerryZhou
JerryZhou

Reputation: 5206

You should see similar message in flutter log: The domain/default pair of (../ios/Runner/Info, CFBundleIdentifier) does not exist

This error means Xcode think you plist have invalid format content.

<key>UISupportedInterfaceOrientations</key>         //<------ here is the key
<key>NSPhotoLibraryUsageDescription</key>
<key>NSCameraUsageDescription</key>
<string>Tagueo necesita usar la camara</string>
<key>NSMicrophoneUsageDescription</key>
<string>Tagueo necesita usar el microfono</string>
<array>                                            //<------ here is the value
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>   //<------ please compare this key
<array>                                            //<------ please compare this value
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

You only need to move the key and value togather

<key>UISupportedInterfaceOrientations</key>        //<------ here is the key
<array>                                            //<------ follow with the value
   <string>UIInterfaceOrientationPortrait</string>
   <string>UIInterfaceOrientationLandscapeLeft</string>
   <string>UIInterfaceOrientationLandscapeRight</string>
</array>

Upvotes: 1

Related Questions