Skip to content

GeneratedLexer.kt has conflicts with Java functions in Android 15 #197

Closed

Description

@john-numerade

After updating to use newer R8 functionality in my app I got the following error on my first upload of a new AAB file to Google Play.

Kotlin incompatibilities will cause crashes

Your app uses Kotlin's removeFirst() and removeLast() extension functions, which conflict with Java functions in Android 15. This will cause apps to crash on devices on Android 14 or earlier. Your app uses these functions in the following places:

org.intellij.markdown.lexer.GeneratedLexerKt.pop

To avoid crashes, replace all Kotlin removeFirst() and removeLast() function calls with removeAt(0) and removeAt(list.lastIndex).

Looking at the source code, it does seem that the file and function in question exist in the codebase and could cause an issue if a user used the library in question to trigger that specific markdown lexer and called the .pop() function on an Android 14 or lower device.

fun <E> ArrayList<E>.pop(): E = removeLast()

It seems it might be possible to instead have the library call the following so that it works on Android builds as well as other implementations:

fun <E> ArrayList<E>.pop(): E = removeAt(lastIndex)

Activity

  1. seanfreiburg commented on Jul 10, 2026

    @seanfreiburg

    Seeing this too. Confirmed via APK decompile that this is the only offending call site in our build — R8 retrace mis-attributes it to an unrelated Activity, but the actual bytecode is ArrayList.removeLast() from GeneratedLexerKt.pop, which NoSuchMethodError-crashes on Android 14 and below.

    Also worth flagging: it's still present on the latest 0.7.7 — the pop() = removeLast() line is unchanged.

    +1 for the removeAt(lastIndex) fix; would be great to get a patch release out.

  2. p3rmiashkin commented on Jul 28, 2026

    @p3rmiashkin
    Contributor

    The fix for the problem will be delivered in 0.7.9

  3. seanfreiburg commented on Aug 14, 2026

    @seanfreiburg

    Thank you very much!

  4. rvandermeulen commented on Aug 18, 2026

    @rvandermeulen
    Contributor

    Hi Ilia Permiashkin (@p3rmiashkin), just curious if there's an ETA on 0.7.9 shipping? We're seeing these warnings in the Play Console and would love to be able to get them cleared up 😄. Thanks!

  5. p3rmiashkin commented on Aug 18, 2026

    @p3rmiashkin
    Contributor
  6. rvandermeulen commented on Aug 18, 2026

    @rvandermeulen
    Contributor

    Thanks!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions