Skip to content

webview_flutter_android fails compilation on Kotlin 1.8 #178756

Closed

Description

@fuzzybinary

What package does this bug report belong to?

webview_flutter

What target platforms are you seeing this bug on?

Android

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
[Paste file content here]

Steps to reproduce

  1. Run flutter pub get on a project using webview_flutter and using Kotlin 1.8.x.
  2. Attempt to build for android

Expected results

App builds

Actual results

Compiler error from Android:

e: file:///Users/jeff.ward/.pub-cache/hosted/pub.dev/webview_flutter_android-4.10.6/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt:222:71 Type argument is not within its bounds: should be subtype of 'Any'

Code sample

Code sample

None

Screenshots or Videos

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.38.1, on macOS 15.7.1 24G231 darwin-arm64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Connected device (4 available)
    ! Error: Browsing on the local area network for Jeff’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

Activity

  1. fuzzybinary commented on Nov 18, 2025

    @fuzzybinary
    ContributorAuthor

    Sorry for a lack of much more information. We updated to 2.1.0 across all examples later that day. I only noticed this because it failed our CI on an older version of our library.

    cc: @stuartmorgan-g

  2. stuartmorgan-g commented on Nov 18, 2025

    @stuartmorgan-g
    Contributor

    From Discord, this worked in webview_flutter_android 4.10.5 and failed in 4.10.6. That was just a Pigeon update from 25.3.2 to 26.1.0. The erroring code is from flutter/packages#10039; glancing at the code and the error it looks like this is probably related to having a generic <T> calling a <T : Any>, but I'm not familiar with the details of Kotlin templating.

    /cc @bparrishMines

  3. added
    platform-androidAndroid applications specifically
    packageflutter/packages repository. See also p: labels.
    p: pigeonrelated to pigeon messaging codegen tool
    on Nov 18, 2025
  4. harshadok commented on Nov 19, 2025

    @harshadok
    Image

    Same issue here

  5. github-actions commented on Dec 5, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: pigeonrelated to pigeon messaging codegen toolp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-ecosystemOwned by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions