-0.5 C
New York
Wednesday, December 4, 2024

ios – Flutter CarPlay App Caught on Black Display screen Throughout Construct


I’m making an attempt to implement CarPlay in my Flutter app and adopted article hyperlink to set it up. Nonetheless, after finishing the steps talked about within the article, however after I run it, the app caught in Xcode construct finished and the display screen stays black, and nothing is displayed on CarPlay.

enter image description here

I clone the instance app from the package deal and its works advantageous

principal.dart

Runner.entitlements

 



    com.apple.developer.carplay-parking
    


Data.plist





    CFBundleDevelopmentRegion
    $(DEVELOPMENT_LANGUAGE)
    CFBundleDisplayName
    Flutter Carplay Instance
    CFBundleDocumentTypes
    
    CFBundleExecutable
    $(EXECUTABLE_NAME)
    CFBundleIdentifier
    $(PRODUCT_BUNDLE_IDENTIFIER)
    CFBundleInfoDictionaryVersion
    6.0
    CFBundleName
    flutter_carplay_example
    CFBundlePackageType
    APPL
    CFBundleShortVersionString
    $(FLUTTER_BUILD_NAME)
    CFBundleSignature
    ????
    CFBundleVersion
    $(FLUTTER_BUILD_NUMBER)
    LSRequiresIPhoneOS
    
    UIApplicationSceneManifest
    
        UIApplicationSupportsMultipleScenes
        
        UISceneConfigurations
        
            CPTemplateApplicationSceneSessionRoleApplication
            
                
                    UISceneConfigurationName
                    CarPlay Configuration
                    UISceneDelegateClassName
                    flutter_carplay.FlutterCarPlaySceneDelegate
                
            
            UIWindowSceneSessionRoleApplication
            
                
                    UISceneConfigurationName
                    Default Configuration
                    UISceneDelegateClassName
                    $(PRODUCT_MODULE_NAME).SceneDelegate
                    UISceneStoryboardFile
                    Predominant
                
            
        
    
    UILaunchStoryboardName
    LaunchScreen
    UIMainStoryboardFile
    Predominant
    UISupportedInterfaceOrientations
    
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    
    UISupportedInterfaceOrientations~ipad
    
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationPortraitUpsideDown
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    
    UIViewControllerBasedStatusBarAppearance
    
    CADisableMinimumFrameDurationOnPhone
    
    UIApplicationSupportsIndirectInputEvents
    


Podfile.lock

# Uncomment this line to outline a worldwide platform in your venture
platform :ios, '14.0'

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

venture 'Runner', {
  'Debug' => :debug,
  'Profile' => :launch,
  'Launch' => :launch,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.be a part of('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  until File.exist?(generated_xcode_build_settings_path)
    elevate "#{generated_xcode_build_settings_path} should exist. In the event you're working pod set up manually, ensure that flutter pub get is executed first"
  finish

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT=(.*)/)
    return matches[1].strip if matches
  finish
  elevate "FLUTTER_ROOT not present in #{generated_xcode_build_settings_path}. Attempt deleting Generated.xcconfig, then run flutter pub get"
finish

require File.expand_path(File.be a part of('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

goal 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
finish

post_install do |installer|
  installer.pods_project.targets.every do |goal|
    flutter_additional_ios_build_settings(goal)
  finish
finish

SceneDelegate.swift

//
//  SceneDelegate.swift
//  Runner
//
//  Created by Oğuzhan Atalay on 20.08.2021.
//

@accessible(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, choices connectionOptions: UIScene.ConnectionOptions) {

        guard let windowScene = scene as? UIWindowScene else { return }

        window = UIWindow(windowScene: windowScene)
        let flutterEngine = FlutterEngine(title: "SceneDelegateEngine")
        flutterEngine.run()
        GeneratedPluginRegistrant.register(with: flutterEngine)
        let controller = FlutterViewController.init(engine: flutterEngine, nibName: nil, bundle: nil)
        window?.rootViewController = controller
        window?.makeKeyAndVisible()
    }
}

AppDelegate.swift

import UIKit
import Flutter

@principal
@objc class AppDelegate: FlutterAppDelegate {
    override func utility( _ utility: UIApplication,
                               didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        return true;
    }
}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles