Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

java.lang.IllegalArgumentException: MIME type #90

Description

@Normalnick12

Hi!

Describe the bug

Crash app

To Reproduce

Steps to reproduce the behavior:

  1. Open AddMediaScreen.
  2. Click on "Add Video" or "Add Audio"
 java.lang.IllegalArgumentException: MIME type video/mp4 cannot be inserted into content://media/external/images/media; expected MIME type under image/*
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
        at android.content.ContentProviderProxy.insert(ContentProviderNative.java:549)
        at android.content.ContentResolver.insert(ContentResolver.java:2149)
        at android.content.ContentResolver.insert(ContentResolver.java:2111)
        at com.google.modernstorage.storage.AndroidFileSystem.createMediaStoreUri(AndroidFileSystem.kt:425)
        at com.google.modernstorage.sample.mediastore.MediaStoreViewModel$addMedia$1.invokeSuspend(MediaStoreViewModel.kt:76)

It seems to fix the error you need to change the following:
in MediaStoreViewModel
change field "Collection"
For video ->

collection = MediaStore.Video.Media.getContentUri("external")

For Audio ->

  collection = MediaStore.Audio.Media.getContentUri("external")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions