Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

큰 사이즈의 이미지를 선택하면 앱 종료 #49

Open
Cotidie opened this issue Feb 28, 2022 · 0 comments
Open

큰 사이즈의 이미지를 선택하면 앱 종료 #49

Cotidie opened this issue Feb 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Cotidie
Copy link
Owner

Cotidie commented Feb 28, 2022

문제

폴더 사진으로 큰 사이즈의 이미지를 선택하면 앱이 비정상적으로 종료됩니다.
Room에 약 1MB가 넘는 데이터를 저장하려 할 때 발생하는 오류입니다.

버그 맥락

  1. 폴더를 길게 눌러 '사진 변경'을 선택합니다.
  2. 4MB가 넘는 이미지를 선택합니다.
  3. 앱이 비정상적으로 종료됩니다.

올바른 동작

Room에 바이트배열 대신 파일 주소를 저장해야 합니다.

에러 로그

E/SQLiteQuery: exception: Row too big to fit into CursorWindow requiredPos=1, totalRows=2; query: SELECT * FROM folderTable
    
    --------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.linkit, PID: 13813
    android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=1, totalRows=2
        at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:1001)
        at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:838)
        at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
        at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:161)
        at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:131)
        at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:248)
        at android.database.AbstractCursor.moveToNext(AbstractCursor.java:280)
        at com.example.linkit.data.room.dao.FolderDao_Impl$9.call(FolderDao_Impl.java:221)
        at com.example.linkit.data.room.dao.FolderDao_Impl$9.call(FolderDao_Impl.java:210)
        at androidx.room.CoroutinesRoom$Companion$createFlow$1$1$1.invokeSuspend(CoroutinesRoom.kt:128)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
@Cotidie Cotidie added the bug Something isn't working label Feb 28, 2022
@Cotidie Cotidie changed the title 큰 사이즈의 이미지일 경우 앱 크래쉬 큰 사이즈의 이미지를 선택하면 앱 종료 Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant