I am trying to implement CarPlay in my Flutter app to set it up. However, but when I run it, the app stuck in Xcode build done and the screen stays black, and nothing is displayed on CarPlay Simulator.
The Steps i followed
1 create new flutter project
2 add flutter_carplay
3 added platform :ios, '14.0'
Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '14.1'
# 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)
end
end
4 added SceneDelegate.swift
/
// SceneDelegate.swift
// Runner
//
// Created by Oğuzhan Atalay on 20.08.2021.
//
@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
window = UIWindow(windowScene: windowScene)
let flutterEngine = FlutterEngine(name: "SceneDelegateEngine")
flutterEngine.run()
GeneratedPluginRegistrant.register(with: flutterEngine)
let controller = FlutterViewController.init(engine: flutterEngine, nibName: nil, bundle: nil)
window?.rootViewController = controller
window?.makeKeyAndVisible()
}
}
I am trying to implement CarPlay in my Flutter app to set it up. However, but when I run it, the app stuck in Xcode build done and the screen stays black, and nothing is displayed on CarPlay Simulator.
The Steps i followed
1 create new flutter project
2 add
flutter_carplay
3 added
platform :ios, '14.0'
Podfile
4 added
SceneDelegate.swift
5 Edited
AppDelegate.swift
6 for
Runner.entitlements
i just addedKeychain Sharing
asSigning and capabilities
7 Updated
info.plist
8
Main.dart
i used same as this package example project main.dart