Lemur on Android

Hello :wave:

Today, i was testing lemur on android, so everything works fine, until i added lemur-proto to the dependencies, it shows up this a building error :

Execution failed for task ':hellolemur:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-19.0 (com.google.guava:guava:19.0) and jetified-listenablefuture-1.0 (com.google.guava:listenablefuture:1.0)
     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

Which i fixed using :

configurations.all {
    exclude group: "com.google.guava", module: "listenablefuture"

But, now this pops up :

Execution failed for task ':hellolemur:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'com/simsilica/lemur/style/base/glass-styles.groovy'.

So, i don’t know if this was a mistake or an intended design for lemur-proto, i mean should it be dependent upon lemur with some early release files and no duplicates ?

In the mean time, also does anyone has a quick fix for this (removing duplicate files using gradle) ?


In Java, you can have as many resources as you want with the same name and load them. It’s very convenient for extending existing styles when you add additional components. Lemur will load all of the “glass” style files that it finds, for example.

So when proto added some GUI elements it also extends the glass style with some additional config. Applications are free to do this also.

Unfortunately, in an environment like Android where it collapses everything into one tree it creates problems.

I think others have found a solution around this as I’m not an android user. The files could be combined into one pretty easily though I think not automatically.

1 Like

i don’t mean to interrupt the library design, but i think it might be better to separate the resources of lemur in a lemur-resources module and lemur-proto-resources for lemur-proto…but idk if that’s a proper solution or it will create a mess.

I’m not sure what the point of that would be.

99.99999999% of Lemur users would have to add the additional jar to their dependencies and that other 0.000000001% could just exclude the resources from their build.

It doesn’t solve the multiple resources problem which is super convenient on every platform except phones.

1 Like

@pspeed whats the difference in lemur and lemur-proto? I mean, why are they separate?

Lemur-proto is for incubating things that will eventually be in regular Lemur.

1 Like