Using Room-Guava in Android, cannot find ListenableFuture

Viewed 57

I'm following this: https://developer.android.com/training/data-storage/room/async-queries

I'm trying to use ListenableFuture from Guava, so I included androidx.room:room-guava but Android Studio keeps complaining that "Cannot resolve symbol 'ListenableFuture'" and doesn't suggest any relevant import.

What is the correct import to include in Java source?

Here is my code:


build.gradle(:app)

...
// Guava support for Room, including Optional and ListenableFuture
implementation "androidx.room:room-guava:2.4.3"

Java DAO interface

import androidx.room.Dao;
import androidx.room.Insert;

@Dao
public interface PressureMeasureDao
{
    @Insert
    public ListenableFuture<Integer> insertPressureMeasure(PressureMeasure pressureMeasure);
}
1 Answers
Related