Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Data Persistence CRUD Operations with SQLite Displaying the Data

Blessmore Ndlovu
Blessmore Ndlovu
8,570 Points

APP CRASHES WHEN I RUN AFTER ADDING LOGIC TO DISPLAY DATA

Meme maker crashes when I run it to display a meme. The logcat error log is : 09-05 10:58:24.196 15677-15677/com.teamtreehouse.mememaker E/SQLiteLog: (1) no such column: NAME 09-05 10:58:24.198 15677-15677/com.teamtreehouse.mememaker E/AndroidRuntime: FATAL EXCEPTION: main Process: com.teamtreehouse.mememaker, PID: 15677 android.database.sqlite.SQLiteException: no such column: NAME (code 1): , while compiling: SELECT NAME, _id, ASSET FROM MEMES at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500) at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588) at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58) at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37) at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44) at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1318) at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1165) at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1036) at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1204) at com.teamtreehouse.mememaker.database.MemeDataSource.readMemes(MemeDataSource.java:42) at com.teamtreehouse.mememaker.database.MemeDataSource.read(MemeDataSource.java:34) at com.teamtreehouse.mememaker.ui.fragments.MemeItemFragment.onResume(MemeItemFragment.java:91) at android.app.Fragment.performResume(Fragment.java:2399) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032) at android.app.FragmentManagerImpl.performPendingDeferredStart(FragmentManager.java:869) at android.app.FragmentManagerImpl.startPendingDeferredFragments(FragmentManager.java:1195) at android.app.FragmentManagerImpl.doPendingDeferredStart(FragmentManager.java:1601) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1585) at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:563) at android.support.v13.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:145) at android.support.v4.view.ViewPager.populate(ViewPager.java:1068) at android.support.v4.view.ViewPager.populate(ViewPager.java:914) at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436) at android.view.View.measure(View.java:19857) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:19857) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083) at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:446) at android.view.View.measure(View.java:19857) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689) at android.view.View.measure(View.java:19857) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2275) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1366) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1619) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874) at android.view.Choreographer.doCallbacks(Choreographer.java:686) at android.view.Choreographer.doFrame(Choreographer.java:621) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

1 Answer

Giovanni Esposito
Giovanni Esposito
7,830 Points

Hi Blessmore Ndlovu, Have you checked if in your sqlite you had the name column in MEMES table?