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

Update Kotlin to 1.6.10 #1015

Merged
merged 4 commits into from
Nov 17, 2022
Merged

Update Kotlin to 1.6.10 #1015

merged 4 commits into from
Nov 17, 2022

Conversation

ParaskP7
Copy link
Contributor

@ParaskP7 ParaskP7 commented Nov 17, 2022

This PR upgrades Kotlin to 1.6.10.

FYI: This is primarily done to unblock development with JDK17.


It also includes the following:


Test

  1. Smoke test the app.
  2. Test for build time increases (local & CI).

Review

@planarvoid and @danilo04 as you were also involved in #982.


Make sure strings will be translated:

  • If there are new strings that have to be translated, I have added them to the client's strings.xml as a part of the integration PR.

This 'MaxPermSize' JVM argument was added back in 2016 (July) and as
part of this starting 780ed5d commit.
By now, and with newer versions of Java (see Java 17), this argument has
been effectively removed. As such, when engineers are trying to build
this project with JDK17, they can't, see below exception:

------------------------------------------------------------------------

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at
https://docs.gradle.org/7.4.2/userguide/gradle_daemon.html
Process command line: /opt/homebrew/Cellar/openjdk@17/17.0.5/...
Please read the following process output to find out more:
-----------------------
Unrecognized VM option 'MaxPermSize=512m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

------------------------------------------------------------------------

FYI: This JVM argument went obsolete as part of Java 16 and then
completely removed as part of Java 17, see below:

- Java 16: https://docs.oracle.com/en/java/javase/16/docs/specs/man/
java.html#obsolete-java-options
- Java 17: https://docs.oracle.com/en/java/javase/17/docs/specs/man/
java.html#removed-java-options
This update is necessary because otherwise, with newer versions of Java
(see Java 17), this project cannot be compiled due to the fact that with
JDK17 it is no longer possible to make a field accessible using
reflection. It seems that Kotlin 1.4.20 is doing it, rightfully so, as
that point of time this 1.4.20 version of Kotlin wasn't ready for
Java 17.

FYI: The code fails to compile with the below exception:

------------------------------------------------------------------------

> Task :aztec:compileDebugKotlin FAILED
Could not perform incremental compilation: Could not connect to Kotlin
compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
exception: java.lang.ExceptionInInitializerError
        at org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel.
            <clinit>(LanguageLevel.java:25)
        ...
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
protected void java.util.ResourceBundle.setParent
(java.util.ResourceBundle) accessible: module java.base does not "opens
java.util" to unnamed module @41e77c24
        at java.base/java.lang.reflect.AccessibleObject.
            checkCanSetAccessible(AccessibleObject.java:354)
        ...
        ... 19 more

------------------------------------------------------------------------

Also, as part of this update the 'max/mindBy' were replaced by
'max/mindByOrNull', but other than that everything else remained the
same.
This is done because otherwise the 'testDebugUnitTest' task fails the
test, when run on command line, with the below 'ClassNotFoundException'
error:

------------------------------------------------------------------------

java.lang.NoClassDefFoundError: android/content/ContentResolver
...
Caused by: java.lang.ClassNotFoundException:
couldn't load android.content.ContentResolver
...
Caused by: java.lang.IllegalArgumentException:
Unsupported class file major version 61"

------------------------------------------------------------------------

Release Link: https://github.com/robolectric/robolectric/releases/tag/
robolectric-4.9
@ParaskP7 ParaskP7 self-assigned this Nov 17, 2022
@ParaskP7 ParaskP7 requested a review from a team November 17, 2022 12:18
Copy link
Contributor

@planarvoid planarvoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@ParaskP7 ParaskP7 merged commit 96fb186 into trunk Nov 17, 2022
@ParaskP7 ParaskP7 deleted the build/update-kotlin-to-1.6.10 branch November 17, 2022 13:56
@ParaskP7
Copy link
Contributor Author

Thank you so much for the review and testing @planarvoid , awesome! 🚀 ❤️ 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants