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.
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.
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.
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.
This was fixed by adding the following implementation to the dependencies under build.gradle
(Module: app)
implementation 'android.arch.lifecycle:livedata:1.1.1'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With