Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sudden compile error in Android Studio; error: cannot find symbol class ComputableLiveData

I opened up my project and compiled and ran it, and I'm getting the error mentioned in the title, error: cannot find symbol class ComputableLiveData. I've built a local database using a Room abstraction over SQLite, and the error is occurring in BundleDao_Impl.java.

package com.weaberlumber.programmer.s4s_scan;

import android.arch.lifecycle.ComputableLiveData; //The error is here
import android.arch.lifecycle.LiveData;
import android.arch.persistence.db.SupportSQLiteStatement;
import android.arch.persistence.room.EntityDeletionOrUpdateAdapter;
import android.arch.persistence.room.EntityInsertionAdapter;
import android.arch.persistence.room.InvalidationTracker.Observer;
import android.arch.persistence.room.RoomDatabase;
import android.arch.persistence.room.RoomSQLiteQuery;
import android.arch.persistence.room.util.StringUtil;

I've tried deleting the build folder so that the file could be regenerated, but no luck.

like image 257
Dan Avatar asked Jun 11 '18 15:06

Dan


People also ask

How to solve error cannot find symbol?

List class without declaring the corresponding import, therefore the cannot find symbol error occurs. Adding the missing import statement (line 4 in Fig. 4(b)) solves the problem.

What does cannot find symbol error mean?

Any error that starts "cannot find symbol" means that the compiler doesn't know what that symbol (which can be a variable or a class name) refers to. In the second line of the error, where it says "symbol: class Scanner", that indicates that it doesn't know what the Scanner class is.

Can t resolve symbol Java?

In JavaLanguage, if you get 'cannot resolve symbol', you have used a name that the compiler hasn't recognized. If it is a class name, the compiler cannot find the class. This means that the class has not been imported properly, the name is misspelt (including incorrect cAsE) or the class simply does not exist.


1 Answers

This was fixed by adding the following implementation to the dependencies under build.gradle (Module: app)

    implementation 'android.arch.lifecycle:livedata:1.1.1'
like image 70
Dan Avatar answered Oct 30 '22 19:10

Dan