From a67225603ab3f41bab5ca4af12c694a171a9848f Mon Sep 17 00:00:00 2001 From: toanho Date: Tue, 17 Mar 2026 14:55:01 +0700 Subject: [PATCH 1/5] fix(android): remove double result.success() call in deleteAllCache Utility.deleteAllCache() already calls result.success() internally. Wrapping it in result.success() passed kotlin.Unit to Flutter, causing: IllegalArgumentException: Unsupported value: 'kotlin.Unit' IllegalStateException: Reply already submitted Co-Authored-By: Claude Sonnet 4.6 --- .../kotlin/com/example/video_compress/VideoCompressPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/com/example/video_compress/VideoCompressPlugin.kt b/android/src/main/kotlin/com/example/video_compress/VideoCompressPlugin.kt index 568ec322..325d55be 100644 --- a/android/src/main/kotlin/com/example/video_compress/VideoCompressPlugin.kt +++ b/android/src/main/kotlin/com/example/video_compress/VideoCompressPlugin.kt @@ -63,7 +63,7 @@ class VideoCompressPlugin : MethodCallHandler, FlutterPlugin { result.success(Utility(channelName).getMediaInfoJson(context, path!!).toString()) } "deleteAllCache" -> { - result.success(Utility(channelName).deleteAllCache(context, result)); + Utility(channelName).deleteAllCache(context, result) } "setLogLevel" -> { val logLevel = call.argument("logLevel")!! From c6de2ddbe507f7fef41143bb4740d00174621b54 Mon Sep 17 00:00:00 2001 From: toanho Date: Wed, 18 Mar 2026 10:20:24 +0700 Subject: [PATCH 2/5] chore: upgrade Android build tools for Flutter 3.41+ and 16KB page support - AGP: 8.1.1 -> 8.11.1 - Gradle: 7.x -> 8.13 - compileSdk: 34 -> 35 - Kotlin: 1.9.10 -> 1.9.20 (example) - transcoder: 0.10.5 -> 0.11.2 - Add FVM configuration (.fvmrc) - Remove unnecessary dart:typed_data import --- .fvmrc | 3 +++ .gitignore | 5 ++++- android/build.gradle | 11 ++++++----- android/gradle/wrapper/gradle-wrapper.properties | 5 +++-- .../android/gradle/wrapper/gradle-wrapper.properties | 3 ++- example/android/settings.gradle | 4 ++-- example/pubspec.yaml | 3 ++- lib/src/video_compress/video_compressor.dart | 1 - 8 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 .fvmrc diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 00000000..bf47b4e3 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.41.4" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 723b8f17..04f8fe18 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,7 @@ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m GeneratedPluginRegistrant.java build/ -.flutter-plugins \ No newline at end of file +.flutter-plugins + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 45da423b..3f294b7c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' + classpath 'com.android.tools.build:gradle:8.11.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -32,7 +32,7 @@ android { namespace 'com.example.video_compress' } - compileSdk 34 + compileSdk 35 compileOptions { sourceCompatibility 1.8 @@ -46,15 +46,16 @@ android { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - minSdkVersion 21 + minSdk 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - lintOptions { + lint { disable 'InvalidPackage' } } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'com.otaliastudios:transcoder:0.10.5' + implementation 'com.otaliastudios:transcoder:0.11.2' + compileOnly 'io.flutter:flutter_embedding_debug:1.0.0-ff37bef603d97e6e7c5e67f85ec15c6190e5d9f8' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index aed1030c..37f853b1 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Fri May 17 15:24:59 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574e..e15e4903 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Wed Mar 18 09:09:19 ICT 2026 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index c5fb685a..4ca3da72 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.9.10" apply false + id "com.android.application" version "8.11.1" apply false + id "org.jetbrains.kotlin.android" version "1.9.20" apply false } include ":app" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 453ecec7..2cdf1064 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Demonstrates how to use the video_compress plugin. publish_to: 'none' environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: flutter: @@ -20,6 +20,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^5.0.0 video_compress: path: ../ diff --git a/lib/src/video_compress/video_compressor.dart b/lib/src/video_compress/video_compressor.dart index 3b7b38e3..de2ef4c1 100644 --- a/lib/src/video_compress/video_compressor.dart +++ b/lib/src/video_compress/video_compressor.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; From 57e3eb485ec33d1e22a161c9a0e60e38dd1d0130 Mon Sep 17 00:00:00 2001 From: toanho Date: Tue, 21 Apr 2026 13:13:30 +0700 Subject: [PATCH 3/5] fix(android): remove hardcoded flutter_embedding_debug dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plugin build.gradle hardcoded io.flutter:flutter_embedding_debug with a stale engine hash (ff37bef...), which no longer exists on download.flutter.io. This broke releaseCompileClasspath resolution for any app using a current Flutter SDK: Could not find io.flutter:flutter_embedding_debug:1.0.0-ff37bef... Flutter plugins should not declare io.flutter:flutter_embedding_* — the Flutter tool injects the correct embedding variant (debug/profile/ release) via flutter.gradle during app builds. Removing the line fixes release builds without affecting plugin compilation. Co-Authored-By: Claude Opus 4.7 (1M context) --- android/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 3f294b7c..6eb41dcf 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -57,5 +57,4 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation 'com.otaliastudios:transcoder:0.11.2' - compileOnly 'io.flutter:flutter_embedding_debug:1.0.0-ff37bef603d97e6e7c5e67f85ec15c6190e5d9f8' } From 3352615592e00c18943a6c3790c0daff365d57bf Mon Sep 17 00:00:00 2001 From: toanho Date: Tue, 21 Apr 2026 13:44:18 +0700 Subject: [PATCH 4/5] =?UTF-8?q?chore:=20release=203.1.5=20=E2=80=94=20docu?= =?UTF-8?q?ment=20fork,=20add=20CI,=20bump=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bump version to 3.1.5 (fork release) - Point homepage to hm-toan/VideoCompress - Add CI workflow (analyze + build example APK release) to prevent regressions like the hardcoded flutter_embedding_debug issue - Document fork reason and consumption in README - CHANGELOG entry for 3.1.5 Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 7 +++++++ README.md | 16 ++++++++++++++++ pubspec.yaml | 4 ++-- 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..870ad832 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.41.4' + cache: true + - run: flutter pub get + - run: flutter analyze + + build-android: + name: Build example APK (release) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.41.4' + cache: true + - name: Install example deps + working-directory: example + run: flutter pub get + - name: Build release APK + working-directory: example + run: flutter build apk --release diff --git a/CHANGELOG.md b/CHANGELOG.md index f3361274..98675b29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.1.5 (hm-toan fork) + +- fix(android): remove hardcoded `io.flutter:flutter_embedding_debug` with stale + engine hash — Flutter tool auto-injects the correct embedding variant via + `flutter.gradle`. Hardcoding it broke `releaseCompileClasspath` resolution + on current Flutter SDKs. + ## 3.1.4 - Removes references to v1 Flutter Android embedding classes. diff --git a/README.md b/README.md index 3d2e09bf..84e383da 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ # video_compress +> **Fork notice (hm-toan):** Fork of [jonataslaw/VideoCompress](https://github.com/jonataslaw/VideoCompress) maintained for Flutter 3.41+ compatibility. +> +> Changes vs upstream: +> - AGP 8.11.1, Kotlin 1.9.10, compileSdk 35 (16 KB page-size support) +> - Transcoder bumped to 0.11.2 +> - Drops hardcoded `io.flutter:flutter_embedding_debug` (broke `releaseCompileClasspath` on current Flutter SDKs) +> +> Consume via git ref, e.g. in `pubspec.yaml`: +> ```yaml +> dependency_overrides: +> video_compress: +> git: +> url: https://github.com/hm-toan/VideoCompress.git +> ref: v3.1.5 +> ``` + Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library. 100% native code was used, we do not use FFMPEG as it is very slow, bloated and the GNU license is an obstacle for commercial applications. In addition, google chrome uses VP8/VP9, safari uses h264, and most of the time, it is necessary to encode the video in two formats, but not with this library. diff --git a/pubspec.yaml b/pubspec.yaml index c29378f5..e73915a1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: video_compress description: Light library of video manipulation of Flutter. Compress video, remove audio, get video thumbnail from dart code. -version: 3.1.4 -homepage: https://github.com/jonataslaw/VideoCompress +version: 3.1.5 +homepage: https://github.com/hm-toan/VideoCompress environment: sdk: ">=3.0.0 <4.0.0" From fd5f0087a5fb64f9f7be76d59882e341b52bd0b5 Mon Sep 17 00:00:00 2001 From: toanho Date: Tue, 5 May 2026 11:10:03 +0700 Subject: [PATCH 5/5] fix(android): AGP 8 + Kotlin 2.1 + JVM 17 compat --- android/build.gradle | 18 ++++++------------ android/src/main/AndroidManifest.xml | 3 +-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 6eb41dcf..7b1225bf 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'com.example.video_compress' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.9.10' + ext.kotlin_version = '2.1.0' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.11.1' + classpath 'com.android.tools.build:gradle:8.7.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -26,20 +26,14 @@ apply plugin: 'kotlin-android' android { namespace 'com.example.video_compress' - - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'com.example.video_compress' - } - - compileSdk 35 + compileSdk 36 compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = '17' } sourceSets { diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 55d34d07..e12fbb68 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - +