Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Potato Pie
@piepotato_gitlab
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
Chenai Nakam
@chenakam
@pfn Do you have an upgrade plan?
I mean at least maybe "com.android.tools.build" % "manifest-merger" % "25.3.0" is needed.
Chenai Nakam
@chenakam
A lot of merging issues of res brought me a lot of trouble. You can also tell me how to start, I will do it myself.
Perry
@pfn
I don't have one right now @chenakam -- I've been out of it for a while and haven't looked at scala stuff at all
mostly it's import new libraries and make sure everything builds :D
Chenai Nakam
@chenakam
[IJ]> compile
[warn] Credentials file /Users/weichou/.bintray/.credentials does not exist
[info] Compiling 33 Scala sources to /Users/weichou/git/me-github/sbt-android/target/scala-2.10/sbt-0.13/classes...
[error] /Users/weichou/git/me-github/sbt-android/src/Keys.scala:11: object AndroidBuilder is not a member of package com.android.builder.core
[error] import com.android.builder.core.AndroidBuilder
[error]        ^
[error] /Users/weichou/git/me-github/sbt-android/src/tasks.scala:23: object BuildConfigGenerator is not a member of package com.android.builder.compiling
[error] import com.android.builder.compiling.{BuildConfigGenerator, ResValueGenerator}
[error]        ^
[error] /Users/weichou/git/me-github/sbt-android/src/aggregates.scala:8: object AndroidBuilder is not a member of package com.android.builder.core
[error] import com.android.builder.core.{AndroidBuilder, DexOptions}
[error]        ^
[error] /Users/weichou/git/me-github/sbt-android/src/aggregates.scala:18: not found: type AndroidBuilder
[error]                                           builder: Logger => AndroidBuilder)
[error]                                                              ^
[error] /Users/weichou/git/me-github/sbt-android/src/Keys.scala:334: not found: type AndroidBuilder
[error]     val builder = SettingKey[Logger => AndroidBuilder]("android-builder", "AndroidBuilder object") in Android
[error]                                        ^
[error] /Users/weichou/git/me-github/sbt-android/src/Dex.scala:6: object AndroidBuilder is not a member of package com.android.builder.core
[error] import com.android.builder.core.AndroidBuilder
[error]        ^
[error] /Users/weichou/git/me-github/sbt-android/src/Dex.scala:212: not found: type AndroidBuilder
[error]       bldr: AndroidBuilder, base: File, bin: File,
[error]             ^
[error] /Users/weichou/git/me-github/sbt-android/src/Dex.scala:54: not found: type AndroidBuilder
[error]   def dex(bldr: AndroidBuilder, dexOpts: Aggregate.Dex, pd: Seq[(File,File)],
[error]                 ^
[error] /Users/weichou/git/me-github/sbt-android/src/Resources.scala:7: object res2 is not a member of package com.android.ide.common
[error] import com.android.ide.common.res2._
[error]                               ^
[error] /Users/weichou/git/me-github/sbt-android/src/tasks.scala:1055: type mismatch;
[error]  found   : java.io.File
[error]  required: Iterable[java.io.File]
[error]         layout.gen, jar.get, processManifest.value, null, resTarget, null)
[error]                         ^
[error] /Users/weichou/git/me-github/sbt-android/src/aggregates.scala:20: not found: type AndroidBuilder
[error]   private[android] case class Aapt(builder: Logger => AndroidBuilder,
[error]                                                       ^
[error] /Users/weichou/git/me-github/sbt-android/src/Resources.scala:17: object Aapt is not a member of package com.android.builder.internal.aapt
[error] import com.android.builder.internal.aapt.{Aapt, AaptPackageConfig}
[error]        ^
[error] /Users/weichou/git/me-github/sbt-android/src/Resources.scala:305: not found: type Aapt
[error]                logger: Logger): Aapt = {
[error]                                 ^
[error] /Users/weichou/git/me-github/sbt-android/src/Resources.scala:4: object AndroidBuilder is not a member of package com.android.builder.core
[error] import com.android.builder.core.{AndroidBuilder, VariantType}
[error]        ^
[error] /Users/weichou/git/me-github/sbt-android/src/Resources.scala:303: not found: type AndroidBuilder
[error]   def makeAapt(bldr: AndroidBuilder, bt: BuildToolInfo, aaptTemp: File,
[error]                      ^
[error] /Users/weichou/git/me-github/sbt-android/src/Resources.scala:348: not found: type AndroidBuilder
[error]   def aapt(bldr: AndroidBuilder, manifest: File, pkg: String,
[error]                  ^
[error] /Users/weichou/git/me-github/sbt-android/src/Resources.scala:19: object OutOfProcessAaptV2 is not a member of package com.android.builder.internal.aapt.v2
[error] import com.android.builder.internal.aapt.v2.OutOfProcessAa
I have successfully upgraded and loaded the sbt project, and I got the following error when compiling.
Chenai Nakam
@chenakam
A large number of APIs are not compatible anymore.
Perry
@pfn
yep, it's pretty sucky @chenakam -- need to dig through and adapt to all the new changes
Maciej Gorywoda
@makingthematrix

Hi all. And Happy New Year.

I'm working at Wire, an encrypted messenger,. Our Android client app is written in Scala. We're slowly migrating it to Kotlin.
I want to make a conference talk about the attempts of writing Scala on Android - how it went, what were the problems, what can still be done in the future.
Especially, @pfn, if you have some time and want to talk about this, I'd like to ask you some questions about your experiences. But everyone else, please ping me if you want to talk. I will be checking this channel every few days, but you can also find me on Twitter, where I live, basically. https://twitter.com/makingthematrix

Maciej Gorywoda
@makingthematrix
Haha :) That Scala 2.13 app is just a small experiment, but it got some attention. It looks like there is some interest in Android in the community after all.