Hi, I get a crash when I open an activity that uses SugarORM.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dcs.wallhouse, PID: 13999
java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzeho
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at com.orm.util.ReflectionUtil.getDomainClass(ReflectionUtil.java:270)
at com.orm.util.ReflectionUtil.getDomainClasses(ReflectionUtil.java:254)
at com.orm.SchemaGenerator.createDatabase(SchemaGenerator.java:37)
at com.orm.SugarDb.onCreate(SugarDb.java:26)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:251)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
at com.orm.SugarDb.getDB(SugarDb.java:36)
at com.orm.SugarRecord.find(SugarRecord.java:189)
at com.orm.query.Select.list(Select.java:118)
at com.dcs.wallhouse.utils.FavouriteUtils.getListFromDb(FavouriteUtils.java:42)
at com.dcs.wallhouse.utils.FavouriteUtils.checkIfThisIsFavorite(FavouriteUtils.java:27)
at com.dcs.wallhouse.DetailActivity.onResume(DetailActivity.java:219)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258)
at android.app.Activity.performResume(Activity.java:6312)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
The line where it is crashing:
@Override
protected void onResume() {
if(FavouriteUtils.checkIfThisIsFavorite(mWallpaper)) {
Log.v(LOG_TAG, "Wallpaper already in fav");
mFavouriteIv.setImageResource(R.drawable.ic_favorite_black_24dp);
}else if(!FavouriteUtils.checkIfThisIsFavorite(mWallpaper)) {
Log.v(LOG_TAG, "Wallpaper not in fav");
mFavouriteIv.setImageResource(R.drawable.ic_favorite_border_black_24dp);
}
super.onResume();
}
My FavouriteUtls class:
`public class FavouriteUtils {
private final static String WHERE_CLAUSE_ID = "m_url";
public static void addThisToFavorites(Wallpaper s){
s.save();
Log.v("FAVUTILS", "item added from fav");
}
public static void removeThisFromFavorites(Wallpaper s){
getListFromDb(s, WHERE_CLAUSE_ID).get(0).delete();
Log.v("FAVUTILS", "item removed from fav");
}
public static boolean checkIfThisIsFavorite(Wallpaper s){
List<Wallpaper> results = getListFromDb(s, WHERE_CLAUSE_ID);
if(results.size() > 0){
//found match
return true;
}else {
//no match
return false;
}
}
private static List<Wallpaper> getListFromDb(Wallpaper s, String whereClause){
//check for unique walls by URL (since earth sat walls doesn't have ids)
String wallId = s.getUrl();
return Select.from(Wallpaper.class)
.where(Condition.prop(whereClause)
.eq(wallId))
.list();
}
public static List<Wallpaper> getAllFavorites(){
return Wallpaper.listAll(Wallpaper.class);
}
Hi, I get a crash when I open an activity that uses SugarORM.
The line where it is crashing:
My FavouriteUtls class:
}`
my dependencies:
my manifest: