Skip to content

Commit 03a2781

Browse files
rabbleclaude
andauthored
fix(ios): pin pro_image_editor <12.0.5 to fix Codemagic build (#2049)
* fix(ios): pin pro_image_editor <12.0.5 to fix Codemagic build v12.0.5 added sharedDarwinSource with a darwin/ podspec directory that CocoaPods on Codemagic cannot resolve, causing pod install to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(video-editor): add safeFilePath shim for pro_image_editor 12.0.4 EditorAudio.safeFilePath() was added in 12.0.5 which we can't use due to its broken darwin podspec. Add a local static helper that provides equivalent functionality. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 39dfbe8 commit 03a2781

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

mobile/lib/services/video_editor/video_editor_render_service.dart

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,9 @@ class VideoEditorRenderService {
645645
endTime: VideoEditorConstants.maxDuration,
646646
enableAudio: enableAudio,
647647
shouldOptimizeForNetworkUse: true,
648-
customAudioPath: await parameters?.customAudioTrack?.audio.safeFilePath(),
648+
customAudioPath: await _getAudioFilePath(
649+
parameters?.customAudioTrack?.audio,
650+
),
649651
loopCustomAudio: false,
650652
originalAudioVolume: originalAudioVolume,
651653
customAudioVolume: customAudioVolume,
@@ -699,4 +701,23 @@ class VideoEditorRenderService {
699701
}
700702
}
701703
}
704+
705+
/// Returns a file path for the given [EditorAudio], writing bytes to a
706+
/// temp file if necessary. Equivalent to `EditorAudio.safeFilePath()` which
707+
/// was added in pro_image_editor 12.0.5.
708+
static Future<String?> _getAudioFilePath(EditorAudio? audio) async {
709+
if (audio == null) return null;
710+
if (audio.file != null) return audio.file!.path;
711+
if (audio.assetPath != null) return audio.assetPath;
712+
if (audio.networkUrl != null) return audio.networkUrl;
713+
if (audio.bytes != null) {
714+
final tempDir = await getTemporaryDirectory();
715+
final tempFile = File(
716+
'${tempDir.path}/${DateTime.now().millisecondsSinceEpoch}.mp3',
717+
);
718+
await tempFile.writeAsBytes(audio.bytes!);
719+
return tempFile.path;
720+
}
721+
return null;
722+
}
702723
}

mobile/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,10 +1692,10 @@ packages:
16921692
dependency: "direct main"
16931693
description:
16941694
name: pro_image_editor
1695-
sha256: "14f5741ce6c93d23cd7f331cead016e782820f7126b9e18d950b8e0b46c1a9d0"
1695+
sha256: "2be8ab313b258a61f08c401849516216256ce94a2947051fd8ed50bf4f339def"
16961696
url: "https://pub.dev"
16971697
source: hosted
1698-
version: "12.0.5"
1698+
version: "12.0.4"
16991699
pro_video_editor:
17001700
dependency: "direct main"
17011701
description:

mobile/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ dependencies:
168168
convert: ^3.1.2
169169
audio_session: ^0.2.2
170170
pro_video_editor: ^1.7.0
171-
pro_image_editor: ^12.0.5
171+
pro_image_editor: ">=12.0.0 <12.0.5"
172172
linked_scroll_controller: ^0.2.0
173173
flutter_colorpicker: ^1.1.0
174174
file_picker: ^10.3.7

0 commit comments

Comments
 (0)