chat-sdk-android icon indicating copy to clipboard operation
chat-sdk-android copied to clipboard

Crash on Take Picture

Open matheuaviczki opened this issue 9 years ago • 4 comments

Its not loading the bitmap file of the local path. Its the local: /storage/emulated/0/Pictures/AndroidChatSDK/674ehtlingq1tdg0n70e7idi78.jpg More using the method getCompressed(String filePath) my bitmap return null.

public static Bitmap getCompressed(String filePath){ File file = new File(filePath); Bitmap test = BitmapFactory.decodeFile(file.getAbsolutePath()); return getCompressed(filePath, BDefines.ImageProperties.MAX_WIDTH_IN_PX, BDefines.ImageProperties.MAX_HEIGHT_IN_PX); }

As it returns me null, it breaks the application. What can it be ?

matheuaviczki avatar May 31 '17 14:05 matheuaviczki

Hi @matheuaviczki,

Looking at your storage path can you confirm whether this is on a real device or an emulated device?

/storage/emulated/0/Pictures/AndroidChatSDK/674ehtlingq1tdg0n70e7idi78.jpg

It is worth noting that a phone emulator doesn't have a camera so will not be able to take a picture and will most likely return an error and crash the camera,

Simon

simonsmiley64 avatar Jun 01 '17 08:06 simonsmiley64

Its testing on real device @simonsmiley64

matheuaviczki avatar Jun 01 '17 12:06 matheuaviczki

@simonsmiley64 hey simon, that last version of sdk have invoke permission to read and write ? and support permission for api 23 > ??

matheuaviczki avatar Jun 01 '17 16:06 matheuaviczki

Fixed in v4.0.

bensmiley avatar Oct 19 '17 16:10 bensmiley