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

App crashing on deleting images #2979

Open
1 of 2 tasks
sonusourav opened this issue Jan 16, 2020 · 0 comments · May be fixed by #2986
Open
1 of 2 tasks

App crashing on deleting images #2979

sonusourav opened this issue Jan 16, 2020 · 0 comments · May be fixed by #2986
Labels

Comments

@sonusourav
Copy link
Member

sonusourav commented Jan 16, 2020

Describe the bug
The app crashes when we press the delete icon in the action bar inside any folder. I have observed that some files get deleted while some not. Also, there is no problem if one image is present.

To Reproduce

  1. Go to Gallery
  2. Click on any folder
  3. Click on delete icon on action bar
  4. App crashes

Expected behavior
All the photos should get deleted.

Logs

2020-01-16 14:52:41.181 11408-11901/org.fossasia.phimpme E/AndroidRuntime: FATAL EXCEPTION: AsyncTask 5
Process: org.fossasia.phimpme, PID: 11408
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:325)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:760)
Caused by: io.realm.exceptions.RealmPrimaryKeyConstraintException: Primary key value already exists: /storage/emulated/0/.nomedia/IMG-20200116-WA0000.jpg .
(/Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsObject.cpp:237)
at io.realm.internal.OsObject.nativeCreateNewObjectWithStringPrimaryKey(Native Method)
at io.realm.internal.OsObject.createWithPrimaryKey(OsObject.java:202)
at io.realm.Realm.createObjectInternal(Realm.java:1049)
at io.realm.Realm.createObject(Realm.java:1024)
at org.fossasia.phimpme.gallery.activities.LFMainActivity.addTrashObjectsToRealm(LFMainActivity.java:3546)
at org.fossasia.phimpme.gallery.activities.LFMainActivity.access$4300(LFMainActivity.java:146)
at org.fossasia.phimpme.gallery.activities.LFMainActivity$1DeletePhotos.doInBackground(LFMainActivity.java:2159)
at org.fossasia.phimpme.gallery.activities.LFMainActivity$1DeletePhotos.doInBackground(LFMainActivity.java:2034)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more

Screenshots

delete

Smartphone Info:

Device: Redmi 4
Android Version: Android Nougat

Would you like to work on the issue?

  • Yes
  • No
  • Other:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants