Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Android Build error regarding SurfaceAPI related changes. #1812

@ma-vai

Description

@ma-vai

Describe the bug
Starting with version 0.13.1, we get the following Android build errors...

/Users/<user>/.pub-cache/hosted/pub.dev/flutter_webrtc-0.13.1+hotfix.1/android/src/main/java/com/cloudwebrtc/webrtc/SurfaceTextureRenderer.java:118: error: <anonymous com.cloudwebrtc.webrtc.SurfaceTextureRenderer$1> is not abstract and does not override abstract method onSurfaceDestroyed() in Callback
            new TextureRegistry.SurfaceProducer.Callback() {
                                                           ^
/Users/<user>/.pub-cache/hosted/pub.dev/flutter_webrtc-0.13.1+hotfix.1/android/src/main/java/com/cloudwebrtc/webrtc/SurfaceTextureRenderer.java:124: error: method does not override or implement a method from a supertype
              @Override
              ^

It seems like the deprecated override was removed; however, according to
https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.SurfaceProducer.Callback.html
it seems like in addition to implementing the newer methods, the old ones should have been kept overridden.

To Reproduce
Use the plugin version 0.13.1 and greater (as of now), and do an Android build to get the errors.

Expected behavior
Android builds should complete successfully without errors.

Platform information

  • Flutter version:
    `[✓] Flutter (Channel stable, 3.27.4, on macOS 15.3.2 24D81 darwin-arm64, locale en-US)
    • Flutter version 3.27.4 on channel stable at /Users//fvm/versions/3.27.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d8a9f9a52e (9 weeks ago), 2025-01-31 16:07:18 -0500
    • Engine revision 82bd5b7209
    • Dart version 3.6.2
    • DevTools version 2.40.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
• Android SDK at /Users//Library/Android/sdk
• Platform android-35, build-tools 35.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.99.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.108.0

[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.3.2 24D81 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.3.2 24D81 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 134.0.6998.167
! Error: Browsing on the local area network for ’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
• All expected network resources are available.

• No issues found!`

  • Plugin version:
    0.13.1, 0.13.1+hotfix.1

  • OS:
    Android

  • OS version:
    Android 13,14,15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions