Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Roberto Leibman
@rleibman
I've made a phone app with that tech (https://apkpure.com/donemychores/com.dienique.housechores.android), but what I'm looking for is an up-to-date way of writing android apps with scala.
doofin
@doofin
@rleibman scala 2.11 is a little outdated,I have just encounter one or two problems switching from 2.12,but overall it's a quite pleasant experience ,after all we are writing Scala!
There are some efforts for supporting scala 2.12 and sbt 1.0,you can find those experimental branch in github
Perry
@pfn
@doofin good idea, can you send a PR for that? thanks!
hrj
@hrj
Could someone look at this PR: scala-android/sbt-android#338
Perry
@pfn
@hrj, looking to eventually :(
finally have some break from work
Michael Gottschalk
@migo
I'm trying to use the current version of mapbox-android-sdk (9.1.0) with sbt-android. It has com.facebook.soloader as a transitive dependency and now I get this error when compiling:
[error] (guidemate/android:rGenerator) Error: more than one library with package name 'com.facebook.soloader'
The error disappears when I exclude com.facebook.soloader (as expected), but this library is probably needed somewhere, so I don't know if this is really an option.
Does anybody have an idea by what this could be caused and how it could be fixed?
Michael Gottschalk
@migo
I think I will simply use an older version - this version also seems to need Java 9 (which is incompatible with Scala 2.11?). With version 8.1.1, my project seems to compile at least.
Perry
@pfn
@migo I don't have an answer for that now -- I need to do some investigating and get back into working on sbt-android; not sure if it's still valuable
Michael Gottschalk
@migo
What do you mean by "still valuable"? Is there any alternative for scala on android at the moment?
There seems to be a gradle plugin, but this also seems to be discontinued...
Potato Pie
@piepotato_gitlab
Hello guys, I am trying to create a new android app using gen-android. I have followed instructions on scala-android.org and i ended up with this error.
image.png
I am starting sbt in project root directory.
Michael Gottschalk
@migo
@pfn Concerning the problem more than one library with package name ...: It seems to have been a problem in gradle, too. Here, it is suggested that the problem was fixed in a newer gradle version: https://stackoverflow.com/questions/51024717/error-more-than-one-library-with-package-name-android-support-graphics-drawabl
Perry
@pfn
@migo what exactly is the library/dependency that conflicts?
as for value, since android is stuck with scala 2.11 at best, I don't really feel it's worthwhile to keep sbt-android up to date anymore
the fix is to use only the correct dependency graph
it's not a plugin fix to resolve this
Michael Gottschalk
@migo
The problem always seems to occur when I update the support library version from 27.1.1 to 28.0.0.
Michael Gottschalk
@migo
You are right, the problem that we are stuck with scala 2.11 is really annoying. I would not start a new Android project with Scala either. It is really a problem that it is not officially supported.
However, I still have an Android project that uses Scala, so it would be great if it could at least still be built somehow in the near future.
At the moment, it is ok just not to use the support library version 28 oder higher. I just cannot update the dependencies any further then.
Maybe it would be best to migrate the whole code to Kotlin
Perry
@pfn
yeah, that's probably what I would consider next @migo
Régis Blanc
@regb
hey there, I have been fighting with a weird issue when running processManifest, it seems to complain about a tools:targetApi field coming from one of my dependency, here's the start of the stack trace:
java.lang.RuntimeException: [/home/regb/.android/sbt/exploded-aars/com.google.firebase-firebase-common-19.3.0] /home/regb/.android/sbt/exploded-aars/com.google.firebase-firebase-common-19.3.0/AndroidManifest.xml:32:9-36:35: Error: Invalid instruction 'targetApi', valid instructions are : REMOVE,REPLACE,STRICT
I haven't been able to figure out exactly what it the reason for that, I suspect maybe this is a new feature of the manifest parser and sbt-android might not have this feature? I've tried to read through the code of sbt-android and it seems like it links against the manifmerger library from Android, which would be consistent with the theory if it links against a too-old version?
Any solution to this?
It happened after I bumped a bunch of firebase versions ahead, so I will try to go back in time until I can figure it out, but is there something else that I can do?
Régis Blanc
@regb

Alright so I was able to confirm this, firebase-common in version 19.3.0 has this additional attribute:
tools:targetApi="n"
which is not present in version 19.0.0, and when I override which version to use all seems fine?

Is there some settings somewhere that I can tune to enable the support for tools:targetApi ?

Perry
@pfn
@regb that's interesting, I don't have an answer for it, probably would be to update to a more recent manifestmerger... which would suck right now
Régis Blanc
@regb
alright, thanks @pfn, anyway I can live with the previous version of firebase
Régis Blanc
@regb
By skimming through the messages above, I think I understand that there's not much motivation left to maintain sbt-android up to date (maybe due to the fact that both Scala and Android liked to ignore each other?). but I just wanted to say that I personally find this plugin incredibly useful, I have been developing a few native Android games with Scala, using this plugin, and I have also been working on a large cross-platform game library for Scala (same scala code, multiple backend: scalajs, scalanative, awt, android), and in this project, the sbt-android plugin is critical to support the Android backend.
So thanks for all the hard work anyway!
Perry
@pfn
yeah, it'd be nice to followup with more support, but being limited to scala 2.11 really puts a damper on any motivation to go further
I haven't checked to see if desugar works any better, but I don't think so
Régis Blanc
@regb
I don't actually know much about the internals, and haven't looked too much into the Android/java8/scala 2.12 compatibility, but wouldn't it be possible to use d8 to convert the scala bytecode to something compatible for Android? https://developer.android.com/studio/command-line/d8
Perry
@pfn
@regb yeah, that's desugar, and it doesn't work
at least not when I last tried it 2 years ago
Régis Blanc
@regb
ok :/ that's too bad
doofin
@doofin
@pfn Hi I have create a PR : scala-android/sbt-android#342
Perry
@pfn
@doofin I'll give it a look soon, thanks
VijayPasupula
@VijayPasupula
I am very new to both android & scala, I just installed sbt and created android project using sbt-android plugin. Where can I get documentation on programming android apps using scala. Are there any tutorials for it?
wuque hua
@huawuque_gitlab
Does anyone in the chat room speak Chinese?
I need a technician to crack Android software
i Can pay
Perry
@pfn
@VijayPasupula scala on android is dead, you're probably better off using kotlin
VijayPasupula
@VijayPasupula
@pfn Okay 😥. Thanks for ghe reply.
Victor Ivri
@vivri
@VijayPasupula I had some success using Scala.js + Cordova
VijayPasupula
@VijayPasupula
@vivri cool, I will check it.
doofin
@doofin

@VijayPasupula scala on android is dead, you're probably better off using kotlin

No it's not . scala 2.11 is not that old,and this project still provides peerless experience for functional lovers !

Roberto Leibman
@rleibman
Unfortunately many new libraries are no longer supporting 2.11, 2.13 is already a year old! For production cases that's unacceptable, as you may be missing security patches that you can't get (not to mention not being able to use newer libraries)
doofin
@doofin
Java and android libs is not affected by scala version,will you use lots of scala libs in android?
scala 2.11 works without any problems with android 10
Chenai Nakam
@chenakam
@pfn How to config annotationProcessorOptions.arguments in build.sbt?
i have trying to use RoomDatabase and it works well.
Perry
@pfn
@chenakam I'm not sure atm, it's probably going to be a javacOptions setting