Fixed
Status Update
Comments
ng...@gmail.com <ng...@gmail.com> #2
Is this fixed? I'm still seeing this issue with AGP 8.1.0-beta01 + Gradle 8.1
fl...@google.com <fl...@google.com>
yb...@google.com <yb...@google.com> #3
The fix has not been landed.
th...@gmail.com <th...@gmail.com> #4
Due to this bug in CI we hit configuration cache invalidation 100% of the time. Can we make sure the fix lands soon? And especially before 8.1.0 stable.
fl...@google.com <fl...@google.com> #5
I cc'ed you on the CL which should be landed this week.
ng...@gmail.com <ng...@gmail.com> #6
Aurimas, is this 8.1 blocking for Androidx? If not, feel free to remove the "Blocking release" label.
ap...@google.com <ap...@google.com> #7
da...@google.com <da...@google.com> #9
Reassigning to Xav to review CP to 8.1 branch
Description
Version used: 2.1.0-alpha01
Devices/Android versions reproduced on: Nexus 5 (Android 6.0.1) and Emulator (Android 8)
Android Studio 3.3 Canary 13
I create this DAO
import androidx.room.*
import dominando.android.data_room.entity.Book
import io.reactivex.Completable
import io.reactivex.Flowable
import io.reactivex.Maybe
@Dao
interface BookDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun save(book: Book): Completable
@Delete
fun delete(vararg book: Book): Completable
@Query("SELECT * FROM Book WHERE title LIKE :title ORDER BY title")
fun bookByTitle(title: String = "%"): Flowable<List<Book>>
@Query("SELECT * FROM Book WHERE id = :id")
fun bookById(id: String): Maybe<Book>
}
But compilation fails with this error.
error: local variable book is accessed from within inner class; needs to be declared final
When I look to the generated code, this is it.
@Override
public Completable save(Book book) {
return Completable.fromCallable(new Callable() {
@Override
public Void call() throws Exception {
__db.beginTransaction();
try {
__insertionAdapterOfBook.insert(book);
__db.setTransactionSuccessful();
return null;
} finally {
__db.endTransaction();
}
}
});
}
As you can see, book parameter is not marked as final and cannot be accessed inside of Completable.fromCallable.