Skip to content

Commit 6a02294

Browse files
committed
android: onSurfaceCleanup
1 parent 01c7456 commit 6a02294

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

android/build.gradle

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.5.0' // for compileSdk 34. default ndk 26.1.10909125
11+
classpath 'com.android.tools.build:gradle:8.7.0'
1212
}
1313
}
1414

@@ -27,7 +27,7 @@ android {
2727
}
2828
// Bumping the plugin compileSdkVersion requires all clients of this plugin
2929
// to bump the version in their app.
30-
compileSdk 34
30+
compileSdk 35
3131

3232
// Use the NDK version
3333
// declared in /android/app/build.gradle file of the Flutter project.
@@ -50,8 +50,8 @@ android {
5050
}
5151

5252
compileOptions {
53-
sourceCompatibility JavaVersion.VERSION_1_8
54-
targetCompatibility JavaVersion.VERSION_1_8
53+
sourceCompatibility JavaVersion.VERSION_11
54+
targetCompatibility JavaVersion.VERSION_11
5555
}
5656

5757
defaultConfig {
@@ -93,7 +93,7 @@ def flutterSdkVersion = {
9393
def flutterSdkPath = properties.getProperty("flutter.sdk")
9494
if (flutterSdkPath == null) {
9595
flutterSdkPath = System.env.FLUTTER_ROOT // from flutter.groovy
96-
96+
9797
if (flutterSdkPath == null) {
9898
// add-to-app local.properties file located at <modulePath>/.android/local.properties
9999
file(project(":flutter").getProjectDir().getParent() + "/local.properties").withInputStream { properties.load(it) }
@@ -133,5 +133,8 @@ if (flutterSdkVersionInt < 32400) {
133133
println 'rename onSurfaceAvailable to onSurfaceCreated'
134134
preprocessJava(['onSurfaceAvailable': 'onSurfaceCreated'])
135135
}
136+
if (flutterSdkVersionInt < 32800) {
137+
println 'rename onSurfaceCleanup to onSurfaceDestroyed'
138+
preprocessJava(['onSurfaceCleanup': 'onSurfaceDestroyed'])
139+
}
136140
}
137-

android/src/main/java/com/mediadevkit/fvp/FvpPlugin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2024 WangBin <wbsecg1 at gmail.com>
2+
* Copyright (c) 2023-2025 WangBin <wbsecg1 at gmail.com>
33
*/
44
// Use of this source code is governed by a BSD-style license that can be
55
// found in the LICENSE file.
@@ -102,8 +102,8 @@ public void onSurfaceAvailable() {
102102
}
103103

104104
@Override
105-
public void onSurfaceDestroyed() {
106-
Log.d("FvpPlugin", "SurfaceProducer.onSurfaceDestroyed for textureId " + texId);
105+
public void onSurfaceCleanup() {
106+
Log.d("FvpPlugin", "SurfaceProducer.onSurfaceCleanup for textureId " + texId);
107107
textures.remove(texId);
108108
nativeSetSurface(handle, texId, null, 0, 0, tunnel);
109109
}

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
66
# 8.0 does not support compileSdk 34
7-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
7+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

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.5.0' apply false // compileSdk 34
22-
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
21+
id "com.android.application" version '8.7.3' apply false // compileSdk 34
22+
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
2323
}
2424

2525
include ":app"

0 commit comments

Comments
 (0)