Skip to content

Commit dd2c804

Browse files
authored
chore(example): fix example app builds on current toolchains (iOS 27, Apple Silicon, Flutter 3.47) (#1180)
The example app no longer launched on iOS 27 and no longer built for Android at all. This gets it running again on every platform, and clears out config that had drifted from what `flutter create` generates. Scoped entirely to `example/` — no changes to the published package, hence no changeset. ## The actual fix **iOS 27 terminates apps that have not adopted the UIScene lifecycle**, and `flutter run` tool-exits on the resulting device log line, so the app could not be launched on an iOS 27 device at all. Flutter's auto-migrator declined to help (`AppDelegate does not match original template`). The old `AppDelegate` also had a latent bug: under UIScene the app delegate's `window` is `nil`, so `guard let controller = window?.rootViewController` returned early and **skipped plugin registration entirely**. The migration guide calls out that exact pattern. **Android was separately broken** — Flutter 3.47 enforces AGP and Kotlin minimums the example was below, surfaced one at a time (AGP 8.9.1 → 8.11.1, Kotlin 2.1.0 → 2.2.20). ## Cleanups - `EXCLUDED_ARCHS[sdk=iphonesimulator*] = 'arm64'` — a 2020 Intel-Mac workaround that, on Apple Silicon, made every build print `The following target(s) do not support arm64 architecture` and list every plugin. - `use_modular_headers!` — in both Podfiles, in **no** Flutter template. Verified unnecessary by building each platform with SwiftPM disabled so every plugin resolves through CocoaPods (including `flutter_webrtc` + `WebRTC-SDK`, and `permission_handler_apple` on iOS). - Stale project-level `IPHONEOS_DEPLOYMENT_TARGET = 12.1` (every target already overrode to 15.0) and three empty `EXCLUDED_ARCHS = ""`. - `[CP] Embed Pods Frameworks` / `[CP] Copy Pods Resources` — with SwiftPM on, `Flutter` is the only pod left and `pod install` removes them. Brings iOS in line with macOS. - `ndkVersion` was pinned to `27.0.12077973` while five plugins require `28.2.13676358`; now uses `flutter.ndkVersion`. Java target `VERSION_1_8` → `VERSION_17` (the `source/target value 8 is obsolete` warning). ## Verified | platform | result | |---|---| | iOS device (iOS 27.0 beta) | launches | | iOS simulator (iOS 27.0) | launches | | macOS | launches | | Android emulator (clean rebuild) | launches | | web | compiles and boots; UI not captured | ## Deliberately not included - **AGP 9.1.0 / Kotlin 2.4.0 / Gradle 9.3.1** (what `flutter create` now generates). It builds and runs, but buys nothing functional today, and does *not* unlock built-in Kotlin — `device_info_plus 12.3.0` blocks that regardless. Flutter still ships `android.builtInKotlin=false` in its own template. Left for when the ecosystem catches up. Note Flutter already warns that AGP 8.11.1, Kotlin 2.2.20 and Gradle 8.14 will "soon be dropped", so this is a *when*, not an *if*. - A `RunnerTests` target. Neither platform has one, which is why the Podfiles cannot match the template. Not worth adding to an example app. ## Unrelated issue found `flutter build` runs `rsync -av --delete <repo>/ → example/build/<platform>/SourcePackages/client-sdk-flutter` — the destination is **inside** the source, because `livekit_client` is a `path:` dependency on the repo root. From a clean `build/` it is one bounded ~737 MB copy, but each build re-copies the previous copies. It reached 30 GB and later 43 GB during this work, nesting 9 levels deep. Workaround is `flutter clean` between platform switches; the real fix is upstream in Flutter, and it will hit any plugin repo whose example depends on its parent by path.
1 parent d93f52d commit dd2c804

10 files changed

Lines changed: 64 additions & 77 deletions

File tree

example/analysis_options.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ analyzer:
3939
- "**/*.pbenum.dart"
4040
- "**/*.pbjson.dart"
4141
- "**/*.pbserver.dart"
42+
- build/**
43+
- android/**
44+
- ios/**
45+
- web/**
46+
- windows/**
47+
- macos/**
48+
- linux/**
4249

4350
linter:
4451
rules:

example/android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ plugins {
88
android {
99
namespace = "io.livekit.example"
1010
compileSdk = flutter.compileSdkVersion
11-
ndkVersion = "27.0.12077973"
11+
ndkVersion = flutter.ndkVersion
1212

1313
compileOptions {
14-
sourceCompatibility = JavaVersion.VERSION_1_8
15-
targetCompatibility = JavaVersion.VERSION_1_8
14+
sourceCompatibility = JavaVersion.VERSION_17
15+
targetCompatibility = JavaVersion.VERSION_17
1616
}
1717

1818
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_1_8
19+
jvmTarget = JavaVersion.VERSION_17
2020
}
2121

2222
defaultConfig {

example/android/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
3+
# This builtInKotlin flag was added automatically by Flutter migrator
4+
android.builtInKotlin=false
5+
# This newDsl flag was added automatically by Flutter migrator
6+
android.newDsl=false

example/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version '8.9.1' apply false
22-
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
21+
id "com.android.application" version '8.11.1' apply false
22+
id "org.jetbrains.kotlin.android" version "2.2.20" apply false
2323
}
2424

2525
include ":app"

example/ios/Podfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
platform :ios, '13.0'
2+
platform :ios, '15.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -29,7 +29,6 @@ flutter_ios_podfile_setup
2929

3030
target 'Runner' do
3131
use_frameworks!
32-
use_modular_headers!
3332

3433
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3534
end
@@ -43,11 +42,7 @@ post_install do |installer|
4342
# https://stackoverflow.com/questions/63973136/the-ios-deployment-target-iphoneos-deployment-target-is-set-to-8-0-in-flutter
4443
#
4544
target.build_configurations.each do |config|
46-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.1'
47-
#
48-
# Make it compile with M1 macs
49-
#
50-
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = 'arm64'
45+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
5146
end
5247

5348
end

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@
207207
9705A1C41CF9048500538489 /* Embed Frameworks */,
208208
D7FECD302860997500D04D1C /* Embed App Extensions */,
209209
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
210-
D9316257C44ACC699FF042FD /* [CP] Embed Pods Frameworks */,
211-
846FAB5D745587A695E025C5 /* [CP] Copy Pods Resources */,
212210
);
213211
buildRules = (
214212
);
@@ -320,23 +318,6 @@
320318
shellPath = /bin/sh;
321319
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
322320
};
323-
846FAB5D745587A695E025C5 /* [CP] Copy Pods Resources */ = {
324-
isa = PBXShellScriptBuildPhase;
325-
buildActionMask = 2147483647;
326-
files = (
327-
);
328-
inputFileListPaths = (
329-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
330-
);
331-
name = "[CP] Copy Pods Resources";
332-
outputFileListPaths = (
333-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
334-
);
335-
runOnlyForDeploymentPostprocessing = 0;
336-
shellPath = /bin/sh;
337-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
338-
showEnvVarsInLog = 0;
339-
};
340321
9740EEB61CF901F6004384FC /* Run Script */ = {
341322
isa = PBXShellScriptBuildPhase;
342323
alwaysOutOfDate = 1;
@@ -352,23 +333,6 @@
352333
shellPath = /bin/sh;
353334
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
354335
};
355-
D9316257C44ACC699FF042FD /* [CP] Embed Pods Frameworks */ = {
356-
isa = PBXShellScriptBuildPhase;
357-
buildActionMask = 2147483647;
358-
files = (
359-
);
360-
inputFileListPaths = (
361-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
362-
);
363-
name = "[CP] Embed Pods Frameworks";
364-
outputFileListPaths = (
365-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
366-
);
367-
runOnlyForDeploymentPostprocessing = 0;
368-
shellPath = /bin/sh;
369-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
370-
showEnvVarsInLog = 0;
371-
};
372336
F30F68AB50F7F85C7927F195 /* [CP] Check Pods Manifest.lock */ = {
373337
isa = PBXShellScriptBuildPhase;
374338
buildActionMask = 2147483647;
@@ -479,7 +443,6 @@
479443
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
480444
ENABLE_NS_ASSERTIONS = NO;
481445
ENABLE_STRICT_OBJC_MSGSEND = YES;
482-
EXCLUDED_ARCHS = "";
483446
GCC_C_LANGUAGE_STANDARD = gnu99;
484447
GCC_NO_COMMON_BLOCKS = YES;
485448
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -488,7 +451,7 @@
488451
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
489452
GCC_WARN_UNUSED_FUNCTION = YES;
490453
GCC_WARN_UNUSED_VARIABLE = YES;
491-
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
454+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
492455
MTL_ENABLE_DEBUG_INFO = NO;
493456
SDKROOT = iphoneos;
494457
TARGETED_DEVICE_FAMILY = "1,2";
@@ -510,7 +473,7 @@
510473
DEVELOPMENT_TEAM = 76TVFCUKK7;
511474
ENABLE_BITCODE = NO;
512475
INFOPLIST_FILE = Runner/Info.plist;
513-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
476+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
514477
LD_RUNPATH_SEARCH_PATHS = (
515478
"$(inherited)",
516479
"@executable_path/Frameworks",
@@ -558,7 +521,6 @@
558521
DEBUG_INFORMATION_FORMAT = dwarf;
559522
ENABLE_STRICT_OBJC_MSGSEND = YES;
560523
ENABLE_TESTABILITY = YES;
561-
EXCLUDED_ARCHS = "";
562524
GCC_C_LANGUAGE_STANDARD = gnu99;
563525
GCC_DYNAMIC_NO_PIC = NO;
564526
GCC_NO_COMMON_BLOCKS = YES;
@@ -573,7 +535,7 @@
573535
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
574536
GCC_WARN_UNUSED_FUNCTION = YES;
575537
GCC_WARN_UNUSED_VARIABLE = YES;
576-
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
538+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
577539
MTL_ENABLE_DEBUG_INFO = YES;
578540
ONLY_ACTIVE_ARCH = YES;
579541
SDKROOT = iphoneos;
@@ -615,7 +577,6 @@
615577
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
616578
ENABLE_NS_ASSERTIONS = NO;
617579
ENABLE_STRICT_OBJC_MSGSEND = YES;
618-
EXCLUDED_ARCHS = "";
619580
GCC_C_LANGUAGE_STANDARD = gnu99;
620581
GCC_NO_COMMON_BLOCKS = YES;
621582
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -624,7 +585,7 @@
624585
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
625586
GCC_WARN_UNUSED_FUNCTION = YES;
626587
GCC_WARN_UNUSED_VARIABLE = YES;
627-
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
588+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
628589
MTL_ENABLE_DEBUG_INFO = NO;
629590
SDKROOT = iphoneos;
630591
SWIFT_COMPILATION_MODE = wholemodule;
@@ -648,7 +609,7 @@
648609
DEVELOPMENT_TEAM = 76TVFCUKK7;
649610
ENABLE_BITCODE = NO;
650611
INFOPLIST_FILE = Runner/Info.plist;
651-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
612+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
652613
LD_RUNPATH_SEARCH_PATHS = (
653614
"$(inherited)",
654615
"@executable_path/Frameworks",
@@ -677,7 +638,7 @@
677638
DEVELOPMENT_TEAM = 76TVFCUKK7;
678639
ENABLE_BITCODE = NO;
679640
INFOPLIST_FILE = Runner/Info.plist;
680-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
641+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
681642
LD_RUNPATH_SEARCH_PATHS = (
682643
"$(inherited)",
683644
"@executable_path/Frameworks",
@@ -710,7 +671,7 @@
710671
INFOPLIST_FILE = "LiveKit Broadcast Extension/Info.plist";
711672
INFOPLIST_KEY_CFBundleDisplayName = "LiveKit Broadcast Extension";
712673
INFOPLIST_KEY_NSHumanReadableCopyright = "";
713-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
674+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
714675
LD_RUNPATH_SEARCH_PATHS = (
715676
"$(inherited)",
716677
"@executable_path/Frameworks",
@@ -749,7 +710,7 @@
749710
INFOPLIST_FILE = "LiveKit Broadcast Extension/Info.plist";
750711
INFOPLIST_KEY_CFBundleDisplayName = "LiveKit Broadcast Extension";
751712
INFOPLIST_KEY_NSHumanReadableCopyright = "";
752-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
713+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
753714
LD_RUNPATH_SEARCH_PATHS = (
754715
"$(inherited)",
755716
"@executable_path/Frameworks",
@@ -785,7 +746,7 @@
785746
INFOPLIST_FILE = "LiveKit Broadcast Extension/Info.plist";
786747
INFOPLIST_KEY_CFBundleDisplayName = "LiveKit Broadcast Extension";
787748
INFOPLIST_KEY_NSHumanReadableCopyright = "";
788-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
749+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
789750
LD_RUNPATH_SEARCH_PATHS = (
790751
"$(inherited)",
791752
"@executable_path/Frameworks",

example/ios/Runner/AppDelegate.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import UIKit
22
import Flutter
33

44
@main
5-
@objc class AppDelegate: FlutterAppDelegate {
5+
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
66

77
override func application(
88
_ application: UIApplication,
99
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
1010
) -> Bool {
11-
guard let controller = window?.rootViewController as? FlutterViewController else {
12-
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
13-
}
14-
GeneratedPluginRegistrant.register(with: self)
1511
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
1612
}
13+
14+
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
15+
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
16+
}
1717
}

example/ios/Runner/Info.plist

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>RTCScreenSharingExtension</key>
6-
<string>io.livekit.example.flutter.LiveKit-Broadcast-Extension</string>
7-
<key>RTCAppGroupIdentifier</key>
8-
<string>group.io.livekit.example.flutter</string>
95
<key>CADisableMinimumFrameDurationOnPhone</key>
106
<true/>
117
<key>CFBundleDevelopmentRegion</key>
@@ -32,6 +28,33 @@
3228
<string>$(PRODUCT_NAME) will use camera</string>
3329
<key>NSMicrophoneUsageDescription</key>
3430
<string>$(PRODUCT_NAME) will use microphone</string>
31+
<key>RTCAppGroupIdentifier</key>
32+
<string>group.io.livekit.example.flutter</string>
33+
<key>RTCScreenSharingExtension</key>
34+
<string>io.livekit.example.flutter.LiveKit-Broadcast-Extension</string>
35+
<key>UIApplicationSceneManifest</key>
36+
<dict>
37+
<key>UIApplicationSupportsMultipleScenes</key>
38+
<false/>
39+
<key>UISceneConfigurations</key>
40+
<dict>
41+
<key>UIWindowSceneSessionRoleApplication</key>
42+
<array>
43+
<dict>
44+
<key>UISceneClassName</key>
45+
<string>UIWindowScene</string>
46+
<key>UISceneConfigurationName</key>
47+
<string>flutter</string>
48+
<key>UISceneDelegateClassName</key>
49+
<string>FlutterSceneDelegate</string>
50+
<key>UISceneStoryboardFile</key>
51+
<string>Main</string>
52+
</dict>
53+
</array>
54+
</dict>
55+
</dict>
56+
<key>UIApplicationSupportsIndirectInputEvents</key>
57+
<true/>
3558
<key>UIBackgroundModes</key>
3659
<array>
3760
<string>audio</string>
@@ -55,7 +78,5 @@
5578
</array>
5679
<key>UIViewControllerBasedStatusBarAppearance</key>
5780
<false/>
58-
<key>UIApplicationSupportsIndirectInputEvents</key>
59-
<true/>
6081
</dict>
6182
</plist>

example/macos/Podfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :osx, '10.15'
1+
platform :osx, '12.0'
22

33
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
44
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -28,7 +28,6 @@ flutter_macos_podfile_setup
2828

2929
target 'Runner' do
3030
use_frameworks!
31-
use_modular_headers!
3231

3332
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
3433
end

example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
399399
GCC_WARN_UNUSED_FUNCTION = YES;
400400
GCC_WARN_UNUSED_VARIABLE = YES;
401-
MACOSX_DEPLOYMENT_TARGET = 10.15;
401+
MACOSX_DEPLOYMENT_TARGET = 12.0;
402402
MTL_ENABLE_DEBUG_INFO = NO;
403403
SDKROOT = macosx;
404404
SWIFT_COMPILATION_MODE = wholemodule;
@@ -479,7 +479,7 @@
479479
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
480480
GCC_WARN_UNUSED_FUNCTION = YES;
481481
GCC_WARN_UNUSED_VARIABLE = YES;
482-
MACOSX_DEPLOYMENT_TARGET = 10.15;
482+
MACOSX_DEPLOYMENT_TARGET = 12.0;
483483
MTL_ENABLE_DEBUG_INFO = YES;
484484
ONLY_ACTIVE_ARCH = YES;
485485
SDKROOT = macosx;
@@ -526,7 +526,7 @@
526526
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
527527
GCC_WARN_UNUSED_FUNCTION = YES;
528528
GCC_WARN_UNUSED_VARIABLE = YES;
529-
MACOSX_DEPLOYMENT_TARGET = 10.15;
529+
MACOSX_DEPLOYMENT_TARGET = 12.0;
530530
MTL_ENABLE_DEBUG_INFO = NO;
531531
SDKROOT = macosx;
532532
SWIFT_COMPILATION_MODE = wholemodule;

0 commit comments

Comments
 (0)