I can\'t save an image file in android oreo(8.0) api 26.
The code is working perfectly in api level 25 (7.0) and I didn\'t find any changes in the documentation \"Androi
I am also experiencing the same issue and i am stuck with this issue from 2 months. I have already given permission for WRITE_EXTERNAL_STORAGE in the manifest first and also again checking is it have write permission. I think it is not a permission issue. Because when i test with oreo the folder is creating and there is a corrupted image file in the folder i am creating. Because of that it is not coming to the gallery and then on save it returns me Image not captured. I am getting this problem only in android 7.1.1 and oreo. Upto android 7.0 it is working fine. I have checked with devices samsung galaxy note 8 and google pixel xl 2. I am using a custom camera with with gps and below function
public void onImageAvailable(ImageReader reader) {
Image image = null;
try {
image = reader.acquireLatestImage();
ByteBuffer buffer = image.getPlanes()[0].getBuffer();
byte[] bytes = new byte[buffer.capacity()];
buffer.get(bytes);
save(bytes);
for image byte save and the save function contains the code below
OutputStream output = null;
try {
output = new FileOutputStream(finalFile);
output.write(bytes);
} finally {
if (null != output) {
output.close();
}
}