Questions tagged [android-guava]

Android-guava is a project to bring the best parts of guava to Android. The Optional class should make the process of handling errors in loaders or AsyncTasks that make http requests a little better. By requiring a check for an empty state, indicating an error occurred, your code will be less buggy and easier to follow.

About

Android-guava is a project to bring the best parts of guava to Android. The Optional class should make the process of handling errors in loaders or AsyncTasks that make http requests a little better. By requiring a check for an empty state, indicating an error occurred, your code will be less buggy and easier to follow.

License

Apache License Version 2

Links

Github

34 questions
8
votes
0 answers

How to resolve Program type already present: com.google.common.util.concurrent.ListenableFuture?

My current Android project will now not build due the following error AGPBI: {"kind":"error","text":"Program type already present: com.google.common.util.concurrent.ListenableFuture","sources":[{}],"tool":"D8"} java.lang.RuntimeException:…
Hector
  • 4,016
  • 21
  • 112
  • 211
5
votes
1 answer

Could not resolve com.google.guava:listenablefuture:{strictly 1.0} when testing WorkManager

I have an app that uses WorkManager for some scheduled tasks, and I'm testing it with the aid of a bunch of different frameworks. It seems relevant to this issue that I'm using robolectric and of course androidx.work:work-testing . I'm able to run…
sophia
  • 395
  • 5
  • 13
5
votes
2 answers

How to remedy error caused by guava: Program type already present: com.google.common.util.concurrent.internal.InternalFutures

An AAR library already uses com.google.guava. If an app includes the following in its build.gradle: api 'com.google.guava:guava:27.0-android' Building the app generates the following error: Execution failed for task…
Hong
  • 17,643
  • 21
  • 81
  • 142
4
votes
3 answers

Program type already present: com.google.common.util.concurrent.internal.InternalFutureFailureAccess

I'm getting this error while compiling my project. I've found out that's because of Guava, and reason why I'm getting this, is other lib is using Guava (this component of Guava) too (maybe other version, or just duplicated). I can't find out which…
SkypeDogg
  • 1,000
  • 2
  • 13
  • 28
3
votes
2 answers

Filter object only when predicate input is not the empty string using Guava

I'm learning Guava right now and I have a problem. I have three possible string filters. The thing is that I only want to filter the object collection when the string is not "" (empty string). My other question is how can I filter different members…
Dan Ponce
  • 636
  • 1
  • 8
  • 24
3
votes
1 answer

Guava library duplicate entry error

I am trying to use guava library in my application. But I am also using chromium_webview project from github. This webview project contains guava library. And I get the following error: Error:Execution failed for task …
2
votes
1 answer

Unsatisfiable version constraints with androidTestImplementation Google Truth 1.0 and implementation Google Guava 27.0.1

In short I can't get a minimal and new Android Studio project to build with the following added dependencies: dependencies { ... implementation 'com.google.guava:guava:27.0.1-android' androidTestImplementation…
Enselic
  • 4,434
  • 2
  • 30
  • 42
2
votes
1 answer

Android Runtime NoSuchMethodError

I recently started getting this error in certain scenarios at run time in my app... I have already tried the following : Add proguard rules to include com.google.common. Mutlidex rules so that all the classes get packaged in main dex file I have…
2
votes
2 answers

D8: Type `sun.misc.Unsafe` was not found

After enabling D8 in my android project, I've started seeing these warnings: /Users/yashasvi/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/27.0.1-android/b7e1c37f66ef193796ccd7ea6e80c2b05426182d/guava-27.0.1-android.jar: D8: Type…
Yash
  • 5,225
  • 4
  • 32
  • 65
2
votes
2 answers

Guava Dependency Breaking Jar Built With Kotlin

Issue The Java/Kotlin application runs as expected in from the Main Class in IntelliJ's IDE. However, when the app is built into a .Jar file the following error occurs: java.lang.NoSuchMethodError:…
AdamHurwitz
  • 9,758
  • 10
  • 72
  • 134
2
votes
2 answers

Android project with Guava hitting the limit

I am using Guava in a Android project. I am hitting the 65k method limit which fails the gradle build. I found that this could be resolved by using proguard. I run Proguard on release build and it works fine. I do not want to run proguard on debug…
bond
  • 11,236
  • 7
  • 48
  • 62
2
votes
1 answer

ImmutableMap turns into a HashMap when passed through Intent

I am using Guava collections in an Android project. Just noticed the following behavior: In Activity1: Intent i = new Intent(this, Activity2.class); i.putExtra("extra1", ImmutableMap.of("key1", "value1")); startActivity(i); In…
dimsuz
  • 8,969
  • 8
  • 54
  • 88
1
vote
1 answer

How can use two method from two different models?

I have tough problem with my project. Its hard to explain. I have two different model but, I should compare these two model. Should I make a new model for this two models? Here is Cart.java. There is Voyage.java as a Model. This class differentiate…
Ahmet Yılmaz
  • 425
  • 5
  • 16
1
vote
2 answers

NoSuchMethodError: No static method catching(Lcom/google/common/util/concurrent/ListenableFuture

I want to upload a photo to Google-Photo using google-api-client. Here is my code: gradle file: api 'com.google.api-client:google-api-client:1.26.0' api 'com.google.api-client:google-api-client-android:1.26.0' api…
1
vote
2 answers

How to filter Array of Map with multiple value using Guava

I have an Array containing Map. And I want to filter my array using some (multiple) key and value inside of the map object. For example, WHERE ID > 1 AND Name <> "cc" (key > 1, Name<>"cc"). How can i do that in Java? I have imported the Guava…
Dedy Khaidir
  • 33
  • 1
  • 7
1
2 3