From c3871d5eb629c75276ebd3a507a4a2aaa6f00e63 Mon Sep 17 00:00:00 2001 From: Amit Chaudhary Date: Thu, 28 Mar 2024 16:49:35 +0545 Subject: [PATCH 1/4] upgraded for latest flutter version >= 3.16.19 --- android/build.gradle | 10 +++++----- example/android/build.gradle | 6 +++--- pigeons/messages.dart | 32 ++++++++++++++++---------------- pubspec.yaml | 10 +++++----- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index d7c01a2..21086af 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,29 +5,29 @@ def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"] buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:7.1.3' } } rootProject.allprojects { repositories { google() - jcenter() + mavenCentral() } } -project.getTasks().withType(JavaCompile){ +project.getTasks().withType(JavaCompile).configureEach { options.compilerArgs.addAll(args) } apply plugin: 'com.android.library' android { - compileSdkVersion 29 + compileSdk 23 defaultConfig { minSdkVersion 16 diff --git a/example/android/build.gradle b/example/android/build.gradle index 2e6467a..9b5fe6a 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.21' + ext.kotlin_version = '1.7.21' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.1' + classpath 'com.android.tools.build:gradle:7.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register('clean', Delete) { delete rootProject.buildDir } diff --git a/pigeons/messages.dart b/pigeons/messages.dart index 50d0085..40ac3fd 100644 --- a/pigeons/messages.dart +++ b/pigeons/messages.dart @@ -2,44 +2,44 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 +// @dart = 2.12 import 'package:pigeon/pigeon_lib.dart'; class TextureMessage { - int textureId; + int? textureId; } class LoopingMessage { - int textureId; - bool isLooping; + int? textureId; + bool? isLooping; } class VolumeMessage { - int textureId; - double volume; + int? textureId; + double? volume; } class PlaybackSpeedMessage { - int textureId; - double speed; + int? textureId; + double? speed; } class PositionMessage { - int textureId; - int position; + int? textureId; + int? position; } class CreateMessage { - String asset; - String uri; - String packageName; - String formatHint; - Map httpHeaders; + String? asset; + String? uri; + String? packageName; + String? formatHint; + Map? httpHeaders; } class MixWithOthersMessage { - bool mixWithOthers; + bool? mixWithOthers; } @HostApi(dartHostTestHandler: 'TestHostVideoPlayerApi') diff --git a/pubspec.yaml b/pubspec.yaml index a7b4056..d0bbb91 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,8 +15,8 @@ flutter: default_package: video_player_web dependencies: - meta: ^1.7.0 - video_player_platform_interface: ^6.0.1 + meta: ^1.10.0 + video_player_platform_interface: ^6.2.2 # The design on https://flutter.dev/go/federated-plugins was to leave # this constraint as "any". We cannot do it right now as it fails pub publish @@ -24,7 +24,7 @@ dependencies: # the constraints on the interface pins it. # TODO(amirh): Revisit this (either update this part in the design or the pub tool). # https://github.com/flutter/flutter/issues/46264 - video_player_web: ^2.0.10 + video_player_web: ^2.0.18 flutter: sdk: flutter @@ -34,9 +34,9 @@ dependencies: dev_dependencies: lints: ^1.0.1 pedantic: ^1.11.1 - pigeon: ^3.1.0 + pigeon: ^17.1.0 environment: - sdk: ">=2.14.0 <3.0.0" + sdk: ">=2.14.0 <4.0.0" flutter: ">=2.10.0" From 97697da3f02ab7d06a05cf8baee002687d88b250 Mon Sep 17 00:00:00 2001 From: Amit Chaudhary Date: Thu, 28 Mar 2024 17:44:51 +0545 Subject: [PATCH 2/4] minor changes- upgraded for latest flutter version >= 3.16.19 --- android/build.gradle | 2 +- example/android/app/build.gradle | 2 +- example/android/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 21086af..b9bd6ac 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -27,7 +27,7 @@ project.getTasks().withType(JavaCompile).configureEach { apply plugin: 'com.android.library' android { - compileSdk 23 + compileSdk 33 defaultConfig { minSdkVersion 16 diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 478a838..400e975 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -45,7 +45,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.example" minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/build.gradle b/example/android/build.gradle index 9b5fe6a..4c1002a 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.21' + ext.kotlin_version = '1.9.22' repositories { google() mavenCentral() From 1e7246d15d0dc9e46e4ab1a7a18036ba7132a3cf Mon Sep 17 00:00:00 2001 From: itheamc Date: Wed, 8 Jan 2025 11:16:47 +0545 Subject: [PATCH 3/4] updated cached video player for version 3.27.1 --- android/build.gradle | 3 +- android/src/main/AndroidManifest.xml | 4 +- example/android/app/build.gradle | 63 +++++++++---------- example/android/build.gradle | 19 +----- .../gradle/wrapper/gradle-wrapper.properties | 3 +- example/android/settings.gradle | 30 ++++++--- pubspec.yaml | 8 +-- 7 files changed, 61 insertions(+), 69 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index b9bd6ac..6340500 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -27,7 +27,8 @@ project.getTasks().withType(JavaCompile).configureEach { apply plugin: 'com.android.library' android { - compileSdk 33 + namespace = "com.lazyarts.vikram.cached_video_player" + compileSdk 35 defaultConfig { minSdkVersion 16 diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index bb34529..c4e6c98 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,3 +1 @@ - - + diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 400e975..3794882 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,69 +1,62 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') +def localPropertiesFile = rootProject.file("local.properties") if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> + localPropertiesFile.withReader("UTF-8") { reader -> localProperties.load(reader) } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") if (flutterVersionCode == null) { - flutterVersionCode = '1' + flutterVersionCode = "1" } -def flutterVersionName = localProperties.getProperty('flutter.versionName') +def flutterVersionName = localProperties.getProperty("flutter.versionName") if (flutterVersionName == null) { - flutterVersionName = '1.0' + flutterVersionName = "1.0" } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion flutter.compileSdkVersion + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + jvmTarget = JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.example" - minSdkVersion flutter.minSdkVersion - targetSdkVersion 33 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + applicationId = "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig = signingConfigs.debug } } - namespace 'com.example.example' } flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + source = "../.." } diff --git a/example/android/build.gradle b/example/android/build.gradle index 4c1002a..d2ffbff 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.9.22' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() @@ -18,14 +5,14 @@ allprojects { } } -rootProject.buildDir = '../build' +rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { - project.evaluationDependsOn(':app') + project.evaluationDependsOn(":app") } -tasks.register('clean', Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 6b66533..7bb2df6 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 44e62bc..7b836b1 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.1.0" apply false + id "org.jetbrains.kotlin.android" version "1.9.22" apply false +} + +include ":app" diff --git a/pubspec.yaml b/pubspec.yaml index d0bbb91..67cadfc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ flutter: dependencies: meta: ^1.10.0 - video_player_platform_interface: ^6.2.2 + video_player_platform_interface: ^6.2.3 # The design on https://flutter.dev/go/federated-plugins was to leave # this constraint as "any". We cannot do it right now as it fails pub publish @@ -24,7 +24,7 @@ dependencies: # the constraints on the interface pins it. # TODO(amirh): Revisit this (either update this part in the design or the pub tool). # https://github.com/flutter/flutter/issues/46264 - video_player_web: ^2.0.18 + video_player_web: ^2.3.3 flutter: sdk: flutter @@ -34,9 +34,9 @@ dependencies: dev_dependencies: lints: ^1.0.1 pedantic: ^1.11.1 - pigeon: ^17.1.0 + pigeon: ^22.7.2 environment: - sdk: ">=2.14.0 <4.0.0" + sdk: ">=2.14.0 <5.0.0" flutter: ">=2.10.0" From 3fddf5f99eb71f86ae2b9375a286ce9afc3b68ac Mon Sep 17 00:00:00 2001 From: sujanbhandari1 Date: Wed, 8 Jan 2025 12:59:36 +0545 Subject: [PATCH 4/4] updated gradle version to latest --- android/build.gradle | 7 ++++--- example/android/settings.gradle | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 6340500..ecdfe00 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' + classpath 'com.android.tools.build:gradle:8.2.1' } } @@ -39,8 +39,9 @@ android { } android { compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } } diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 7b836b1..b6863b1 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false + id "com.android.application" version "8.2.1" apply false id "org.jetbrains.kotlin.android" version "1.9.22" apply false }