Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Android 15 - OpenJDK API changes #1949

Merged
merged 2 commits into from
Jan 11, 2025

Conversation

ArthurKun21
Copy link
Collaborator

@ArthurKun21 ArthurKun21 commented Jan 7, 2025

Fix android 15 - OpenJDK API changes

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Description

https://developer.android.com/about/versions/15/behavior-changes-15#openjdk-api-changes

Collision with MutableList.removeFirst() and MutableList.removeLast() extension functions in kotlin-stdlib

The List type in Java is mapped to the MutableList type in Kotlin. Because the List.removeFirst() and List.removeLast() APIs have been introduced in Android 15 (API level 35), the Kotlin compiler resolves function calls, for example list.removeFirst(), statically to the new List APIs instead of to the extension functions in kotlin-stdlib.

If an app is re-compiled with compileSdk set to 35 and minSdk set to 34 or lower, and then the app is run on Android 14 and lower, a runtime error is thrown:

java.lang.NoSuchMethodError: No virtual method
removeFirst()Ljava/lang/Object; in class Ljava/util/ArrayList;

Screenshots

Testing

Additional context

@ArthurKun21 ArthurKun21 changed the title Fix android 15 - openjdk incompatibility Fix android 15 - OpenJDK API changes Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

Build 95

Download the latest APK for testing here

Note

You need a GitHub account to download the APK.

This URL is valid as long as the artifact has not expired yet.

@ArthurKun21 ArthurKun21 changed the title Fix android 15 - OpenJDK API changes Fix Android 15 - OpenJDK API changes Jan 7, 2025
@ArthurKun21 ArthurKun21 requested a review from reconman January 9, 2025 23:24
@reconman reconman merged commit 8d45fe5 into master Jan 11, 2025
1 check passed
@reconman reconman deleted the fix-android-15-incompatibility-problem branch January 11, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Any script that has NP usage as its last command causes FGA to crash when entering Command menu
2 participants