I removed my phone battery when the phone was on without turning it off first, my SD card was encrypted, so now I cannot access my SD card contents on my phone while phone detects the SD card.
Moreover, when I turn my phone on, encryption page shows after boot, giving me the option to encrypt or decrypt the sd card and selecting either encrypt or decrypt won't do anything.
So how can I decrypt my SD card and access my data?
My phone uses android version 6
First, apparently, the phone thinks that the SD card is in the middle of encrypting/decrypting so it will not allow access to SD card while not encrypting/decrypting the SD card either.
to remedy this I removed a
.MetaEcfsFile on my SD card using my computer, after removing this my phone now thinks that the SD card is not encrypted.
Second, I encrypted my already encrypted SD card, the reason that this will not corrupt my data is that starting with Android 5, android uses fast encryption that will only encrypt edited blocks, so enabling encryption will not encrypt your files the second time if you don't change them.
Last, after encryption you decrypt the SD card, android now decrypts the whole SD card not just changed blocks and you can access your files.
I also observed that removing the pattern and lock screen will not make your SD card data inaccessible.