From cf309df28e5e9912a027c558102b2c5a30675c1d Mon Sep 17 00:00:00 2001 From: lml Date: Tue, 17 Mar 2026 18:06:55 +0800 Subject: [PATCH] fix android & ios builds --- .vscode/launch.json | 31 ++++++++++++++++++++++++++++++ android/app/build.gradle.kts | 2 +- ios/Flutter/AppFrameworkInfo.plist | 2 -- ios/Podfile.lock | 5 +---- ios/Runner/AppDelegate.swift | 7 +++++-- ios/Runner/Info.plist | 29 ++++++++++++++++++++++++---- lib/main.dart | 2 +- pubspec.lock | 4 ++-- 8 files changed, 66 insertions(+), 16 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5ee985c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,31 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Flutter", + "type": "dart", + "request": "launch", + "program": "lib/main.dart" + }, + { + "name": "caption_trans", + "request": "launch", + "type": "dart" + }, + { + "name": "caption_trans (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "caption_trans (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index f555484..fb78a12 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -24,7 +24,7 @@ android { applicationId = "com.example.caption_trans" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdk = flutter.minSdkVersion + minSdk = 26 targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 1dc6cf7..391a902 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 13.0 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e827123..c06115c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -48,9 +48,6 @@ PODS: - SwiftyGif (5.4.5) - whisper_ggml_plus (1.3.1): - Flutter - - whisper_ggml_plus/no-arc (= 1.3.1) - - whisper_ggml_plus/no-arc (1.3.1): - - Flutter DEPENDENCIES: - ffmpeg_kit_flutter_new_min (from `.symlinks/plugins/ffmpeg_kit_flutter_new_min/ios`) @@ -87,7 +84,7 @@ SPEC CHECKSUMS: SDWebImage: 16309af6d214ba3f77a7c6f6fdda888cb313a50a shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 - whisper_ggml_plus: a01d7b6bf1208c76137032b9d6c91b1d202038e4 + whisper_ggml_plus: 03dbc05ca07acd625beec982db80b41dae2fe005 PODFILE CHECKSUM: aa138be8409ad2ab7f70f36aee65b237099b922e diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 6266644..c30b367 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -2,12 +2,15 @@ import Flutter import UIKit @main -@objc class AppDelegate: FlutterAppDelegate { +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index b00303b..b023f24 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + FlutterSceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +66,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/lib/main.dart b/lib/main.dart index f63a18a..c72b15b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,7 +20,7 @@ void main() async { // Register FFmpeg converter for automatic video/audio format conversion. // This uses the ffmpeg_kit library internally (no subprocess), // so it works within the macOS sandbox. - if (Platform.isMacOS) { + if (Platform.isMacOS || Platform.isAndroid || Platform.isIOS) { FFmpegMacOsConverter.register(); } else if (Platform.isWindows) { FFmpegWindowsConverter.register(); diff --git a/pubspec.lock b/pubspec.lock index ffb0605..ad5168e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -880,10 +880,10 @@ packages: description: path: "." ref: HEAD - resolved-ref: "649e41882878f2d04d3b087d907161fdb7a2681b" + resolved-ref: "4f15d7bb073d5d2b8f3954e3c091debfd2d60ba1" url: "https://github.com/cddqssc/whisper_ggml_plus.git" source: git - version: "1.4.1" + version: "1.4.2" win32: dependency: transitive description: