Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

WebGMaps Crashing App on Android

 Post Reply Post Reply
Author
George Kirkwood View Drop Down
New Member
New Member
Avatar

Joined: 04 Dec 2010
Posts: 7
Post Options Post Options   Quote George Kirkwood Quote  Post ReplyReply Direct Link To This Post Topic: WebGMaps Crashing App on Android
    Posted: 14 Mar 2017 at 9:38am
We have another problem with the Google Maps component. On windows and iOS, it appears to work fine. But on Android we regularly get the app hanging and completely unresponsive. Looking at the Monitor, we're seeing :

Chromium : [INFO:CONSOLE(34)] "Ignored attempt to cancel a touchscreen event with cancelable=false, for example  because scrolling is in progress and cannot be interrupted.", source : http://maps.google.com/maps/api/js?sensor=false&libraries=panoramio, weather (34).

Is anyone else experiencing hanging in their Maps app ? I can replicate this fairly easily with a map control and a TEdit on a form, then try focusing between the two. Eventually the apps hangs.


Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2081
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 14 Mar 2017 at 10:10am
Hi,

We haven't received any reports for this issue from other users yet.
Can you please provide the following information so I can further investigate this?
- The version of Delphi you are using
- The version of Android you are using (Please note that v4.4 is the minimum required version)

Back to Top
George Kirkwood View Drop Down
New Member
New Member
Avatar

Joined: 04 Dec 2010
Posts: 7
Post Options Post Options   Quote George Kirkwood Quote  Post ReplyReply Direct Link To This Post Posted: 14 Mar 2017 at 2:41pm
I'm using Delphi 10.2. This happens on devices with both Marshmallow (Android 6) and Nougat (Android 7).
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2081
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 15 Mar 2017 at 12:04pm
This was replied to by email.
Back to Top
Kirkwood George View Drop Down
New Member
New Member
Avatar

Joined: 01 Jul 2010
Posts: 1
Post Options Post Options   Quote Kirkwood George Quote  Post ReplyReply Direct Link To This Post Posted: 17 Mar 2017 at 10:10am
Despite TMS' best efforts, this is still happening after the latest update. I have no option but to abandon using the component and use TMapView instead. For what I need, it works fine and doesn't exhibit the same errors on Android.
Back to Top
Powell Graham View Drop Down
Member
Member
Avatar

Joined: 04 Jan 2013
Posts: 85
Post Options Post Options   Quote Powell Graham Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2017 at 1:19pm
Having upgraded to Delphi 10.2 (Tokyo) I am now getting this which may be the same thing.
This line of code causes an exception on Android:

if GMapsReverseGeocoding1.LaunchReverseGeocoding = erOK then
begin
end

I don't see a problem with the Google maps component itself
An FMX Windows application is fine. Also I am using the latest TMS components.


Back to Top
Powell Graham View Drop Down
Member
Member
Avatar

Joined: 04 Jan 2013
Posts: 85
Post Options Post Options   Quote Powell Graham Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2017 at 2:42pm
And it was only after installing the Delphi 10.2 hotfix that I could determine which line of code was causing the exception.
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2081
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2017 at 8:42am
Please note that Embarcadero did breaking changes in the Tokyo release for HTTP request handling on Android specifically (among other breaking changes that also affect Android). So, sadly, these breaking changes affect our WebGMaps geocoding components. We are looking for workarounds for these breaking changes. Given the number of issues with the Android target, we'd really recommend to stick to Delphi 10.1 Berlin till we come up with workarounds and Embarcadero releases an update with fixes.
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2017 at 1:20pm
This problem I have too. I identified in my case is when I use TEDIT, and as soon as it gets the focus, it hangs the application, which even reboots the device. This has since version 10.1 of Radstudio using the component in its latest version.

After examining, I noticed that if there is something in the transfer area (clipboard) of the device it crash, cleaning the transfer area will not cause the problem. But I did not find any solution.

I'm using the latest version of the component and the error persists. I'm also using Radstudio 10.2 Tokyo.
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2081
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2017 at 2:48pm
Originally posted by Gledston de Oliveira Reis

This problem I have too. I identified in my case is when I use TEDIT, and as soon as it gets the focus, it hangs the application, which even reboots the device. This has since version 10.1 of Radstudio using the component in its latest version.

After examining, I noticed that if there is something in the transfer area (clipboard) of the device it crash, cleaning the transfer area will not cause the problem. But I did not find any solution.

I'm using the latest version of the component and the error persists. I'm also using Radstudio 10.2 Tokyo.

Unfortunately this is a native Android class limitation issue which we have no control over.
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2017 at 4:46pm
Originally posted by Bart Holvoet

Originally posted by Gledston de Oliveira Reis

This problem I have too. I identified in my case is when I use TEDIT, and as soon as it gets the focus, it hangs the application, which even reboots the device. This has since version 10.1 of Radstudio using the component in its latest version.

After examining, I noticed that if there is something in the transfer area (clipboard) of the device it crash, cleaning the transfer area will not cause the problem. But I did not find any solution.

I'm using the latest version of the component and the error persists. I'm also using Radstudio 10.2 Tokyo.

Unfortunately this is a native Android class limitation issue which we have no control over.

OK, but error only happens when I use the component. If you do not use the component the, application does not crash!
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2017 at 2:49pm
Well, I did debug using component, and I noticed that when there are many objects in the android clippboard, (samsung s7) definitely crash app. In the following observation the code causes the exception, inside the library FMX.Plataform.Android.pas:


if HasClipboard and (TContextMenuItem.Paste in ItemsToShow) and not TextReadOnly then
      begin
        //Paste button
        ResID := TAndroidHelper.GetResourceID('android:string/paste');
        if ResID <> 0 then
          LA.Text := TAndroidHelper.GetResourceString(ResID)
        else
          LA.Text := SEditPaste.ToUpper;
        FPasteButton := TJButton.JavaClass.init(TAndroidHelper.Activity);
        if ResID <> 0 then
          FPasteButton.setText(ResID)  <- problem is here
        else
          FPasteButton.setText(StrToJCharSequence(LA.Text));
        FPasteButton.setTypeface(TJTypeface.JavaClass.DEFAULT_BOLD);
        FPasteClickListener := TPasteButtonClickListener.Create;
        FPasteButton.setOnClickListener(FPasteClickListener);
        LA.Font.Size := FPasteButton.getTextSize;
        P.X := P.X + Ceil((LA.TextWidth + 2) * FScale);
        P.Y := Max(P.Y, Ceil((LA.TextHeight + 2) * FScale));
        if ApproxHeight = 0 then
          ApproxHeight := P.Y + FPasteButton.getPaddingTop + FPasteButton.getPaddingBottom;
      end;

This only happens when I make use of the component, Any solution?
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3325
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2017 at 2:59pm
Hi, 

Unfortunately this is a FMX Android class limitation issue that has been acknowledged by Embarcadero but hasn't yet been fixed. For more information please refer to the following QC report:

Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2017 at 3:04pm
Originally posted by Pieter Scheldeman

Hi, 

Unfortunately this is a FMX Android class limitation issue that has been acknowledged by Embarcadero but hasn't yet been fixed. For more information please refer to the following QC report:



The embarcadero should have an option to disarm the clipboard while you do not have a solution.
Back to Top
Gledston de Oliveira Reis View Drop Down
New Member
New Member
Avatar

Joined: 21 Mar 2017
Posts: 17
Post Options Post Options   Quote Gledston de Oliveira Reis Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2017 at 8:18pm
Since there is no workaround for this problem, I have done the following to resolve this problem.

1 - In Windows Explorer open the C: \ Program Files (x86) \ Embarcadero \ Studio \ 19.0 \ source \ folder and copy the following file 'FMX.Platform.Android.pas' to another destination folder of your choice.

2 - Open the file and find and comment the following lines (line 1563):

 if HasClipboard and (TContextMenuItem.Paste in ItemsToShow) and not TextReadOnly then
      begin
      { <- BEGIN COMMENT  
    //Paste button
        ResID := TAndroidHelper.GetResourceID('android:string/paste');
        if ResID <> 0 then
          LA.Text := TAndroidHelper.GetResourceString(ResID)
        else
          LA.Text := SEditPaste.ToUpper;
        FPasteButton := TJButton.JavaClass.init(TAndroidHelper.Activity);
        if ResID <> 0 then
          FPasteButton.setText(ResID) 
        else
          FPasteButton.setText(StrToJCharSequence(LA.Text));
        FPasteButton.setTypeface(TJTypeface.JavaClass.DEFAULT_BOLD);
        FPasteClickListener := TPasteButtonClickListener.Create;
        FPasteButton.setOnClickListener(FPasteClickListener);
        LA.Font.Size := FPasteButton.getTextSize;
        P.X := P.X + Ceil((LA.TextWidth + 2) * FScale);
        P.Y := Max(P.Y, Ceil((LA.TextHeight + 2) * FScale));
        if ApproxHeight = 0 then
          ApproxHeight := P.Y + FPasteButton.getPaddingTop + FPasteButton.getPaddingBottom;
}  <- END COMMENT
      end;


Save the file and close.

3 - Open Windows Prompt command and Go to C: \ Program Files (x86) \ Embarcadero \ Studio \ 19.0 \ bin \ folder, run the following command:

C: \ Program Files (x86) \ Embarcadero \ Studio \ 19.0 \ bin> dccaarm.exe c: \ temfolder \ FMX.Platform.Android.pas

After the compilation, two files will be generated: FMX.Platform.Android.dcu and FMX.Platform.Android.o

4- Open radstudio and open your project and add the files FMX.Platform.Android.dcu and FMX.Platform.Android.o (Project> Add to Project in the menu) in your project.

Have fun!

PS1: Do not alter the original files directly, always make a copy of them if there are problems.

PS2: I will not be responsible for any faults, use at your own risk.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3325
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2017 at 8:58am
Hi, 

While the patch works in your application, it could be possible it doesn't work in other applications. The reason why it crashes at that point is because the memory limit is exceeded. It could very well be a different class, in a different unit. There is unfortunately no workaround for this other than to wait for Embarcadero to fix this major issue.
Back to Top
Helge Lange View Drop Down
Member
Member
Avatar

Joined: 18 Jun 2015
Posts: 81
Post Options Post Options   Quote Helge Lange Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jan 2018 at 8:01pm
The error is resolved in QC, does it now work as expected ? Because I'm also still stuck at Delphi 10.1 and the webgmap is a part of my app...
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down