-
Notifications
You must be signed in to change notification settings - Fork 94
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
support for Scala 2.12 #334
Comments
Sadly I have very little experience with the Android toolchain and how APKs are built but here are my thoughts: The Scala 2.12 compiler outputs Java8 bytecode which cannot be directly compiled for Android using the current toolchain because the new bytecode instructions are not supported by the ART. I made a small sbt plugin to test D8: Maybe someone more experienced with this plugin or Android development in general could comment on this? |
Is there any news on this one ? We'd really love to hear some news on this one |
I googled a little bit and stumbled upon the following sites: The first two should give some insight for building APKs. I didn't try it, but this seems to be the way to do it. The last two links are just for further contextualization of how the whole process works (in case a new dev finds this issue and wants to help) As a side note: |
New versions of android support java 8 (sdk 26 and higher). I have managed to use library written on scala 2.12 in android app (gradle project). It seems working on my phone with android 9. |
Unfortunately, this doesn't work :( The easiest way to reproduce - create gradle android project with minSdk 26, set java version to 1.8, enable multidex, add scala 2.12 std lib as dependency and try to call something like Option.apply(1). This fails in runtime with error "IncompatibleClassChangeError" even on android 9. |
@LolHens We may be either able to hook into the Gradle process shortly before packaging or replace the packager entirely. |
FYI, someone managed to get Scala 2.13 working with Android, see https://users.scala-lang.org/t/scala-2-13-on-android/7235 and their example project at https://github.com/androidscala213/AndroidScala213 |
what needs to be done?
The text was updated successfully, but these errors were encountered: