Jump to content
Massimiliano S

Android 10 delphi 10.4 camera and gallery doesn't work

Recommended Posts

Hi,
After updating to delphi 10.4 and SDK 29 the camera and gallery do not work on Android 10
Also delphi examples don't work.

After taking a photo from the camera the app doesn't return anything while the gallery,  after choosing the photo, raises this execption

First chance exception at $ 00000074D87D473C. Exception class EBitmapLoadingFailed with message 'Loading bitmap failed (/data/user/0/com.embarcadero.CameraRoll/cache/IMG_20200911_1728082355078942815963051.jpg).'. Process CameraRoll.apk (11714)

 

any ideas?

Share this post


Link to post

Here the Exception

 

procedure TBitmap.LoadFromFile(const AFileName: string);
var
  Surf: TBitmapSurface;
begin
  TMonitor.Enter(Self);
  try
    Surf := TBitmapSurface.Create;
    try

   if TBitmapCodecManager.LoadFromFile(AFileName, Surf, CanvasClass.GetAttribute(TCanvasAttribute.MaxBitmapSize)) then
        Assign(Surf)

 

 

 

Share this post


Link to post

See https://quality.embarcadero.com/browse/RSP-30935?jql=text%20~%20%22camera%22%20ORDER%20BY%20created%20DESC

 

You have to add "android:requestLegacyExternalStorage="true"" in the AndroidManifest.template.xml

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×