Skip to content

Remove asserts from Android embedding #31928

Closed
flutter-team-archive/engine
#8821

Description

@dnfield

/cc @matthew-carroll @mklim

We've discussed this before - the Android linter says these are unreliable. I'm now working on a bug that appears to be suffering from this (#31139). We have code that asserts the transform we're about to pass isn't null, but this makes me suspect there are many things we're asserting that are never triggered.

We should follow the linter suggestion and use if (BuildConfig.DEBUG) instead and make sure we're setting that configuration properly for debug versions of the engine.

Activity

  1. added
    platform-androidAndroid applications specifically
    engineflutter/engine related. See also e: labels.
    a: debuggingDebugging, breakpoints, expression evaluation
    on May 1, 2019
  2. added this to the June 2019 milestone on May 1, 2019
  3. self-assigned this
    on May 1, 2019
  4. matthew-carroll commented on May 1, 2019

    @matthew-carroll
    Contributor

    @dnfield, agreed. I've brought this up in the past trying to determine whether my understanding that asserts shouldn't exist was correct, or if I was missing something and that these asserts had a place. I never got an answer on that so I tried not to delete them. But if this settles that question then I'd be happy to start replacing them as I come across them in the embedding.

  5. dnfield commented on May 1, 2019

    @dnfield
    ContributorAuthor
  6. matthew-carroll commented on May 1, 2019

    @matthew-carroll
    Contributor

    Are you wanting to migrate all this with one PR, or should I also make these changes progressively?

  7. dnfield commented on May 1, 2019

    @dnfield
    ContributorAuthor

    I'm starting with AccessibilityBridge.java. There aren't many more than in there, I could do them in one PR unless that will cause merge problems for your embedding patches.

  8. matthew-carroll commented on May 1, 2019

    @matthew-carroll
    Contributor

    Should be fine.

  9. dnfield commented on May 2, 2019

    @dnfield
    ContributorAuthor

    This is getting hung up on some buildroot related issues right now. Still looking for either a work around or a fix for buildroot to define the debug constant(s).

  10. github-actions commented on Aug 30, 2021

    @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.

  11. locked as resolved and limited conversation to collaborators on Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: debuggingDebugging, breakpoints, expression evaluationengineflutter/engine related. See also e: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions