QrCode raises error

hi,

Basically when i tried to create TTMSFNCWXQRCode component, TFrame as a parent it raises “Invoke error: method not found”

it raises this error when i call create constructor, i tried it on windows its worked like charm but it looks like android issue.

i have FNCWebChromeClient.jar and JavaScriptHelper.jar in my sdk.
example code:

  if profilePage=nil then
  begin
      profilePage := TFrameProfile.Create(Self);
      profilePage.Parent := Self;
    profilePage.Align := TAlignLayout.Contents;
  end;
  profilePage.LblDisplayName.Text :=  UserInfo.userDisplayName;
{$IF DEFINED(LINUX)}
   {$ELSE}
if profilePage.ProfileQRCode=Nil then
    Begin
      try
        profilePage.ProfileQRCode := TTMSFNCWXQRCode.Create(profilePage);//raises error
        profilePage.ProfileQRCode.Parent := profilePage.clRcQRPanel;
        profilePage.ProfileQRCode.Align := TAlignLayout.Client;
      except
        on E: Exception do
        begin
          RaiseException(e.Message,'[Profile QR Code]');
          if profilePage.ProfileQRCode<>nil then
            profilePage.ProfileQRCode.Free;
        end;
      end;
    End;

if profilePage.ProfileQRCode<>Nil then
begin
  if not UserInfo.AppUserGUID.IsEmpty then
  begin
    profilePage.ProfileQRCode.Text :=  UserInfo.AppUserGUID;
    profilePage.ProfileQRCode.Visible := True;
  end
  else
  begin
    profilePage.ProfileQRCode.Text :=  'Unknown';
    profilePage.ProfileQRCode.Visible := False;
  end;
end;

{$ENDIF}

Devices:

  • Delphi 13
  • Android 16

Hi,

We tried a similar code snippet here but could not see an issue. Can you please provide a small and minimal sample project with a TFrame and TTMSFNCWXQRCode that reproduces the issue?

Hi,

I attempted to reproduce the issue starting this morning. In a clean demo project, everything worked as expected. However, in my main project, the issue continued to occur. Due to this inconsistency, I’m unfortunately unable to provide a reproducible demo project.

I’m sorry that I couldn’t pinpoint the exact root cause, but I wanted to share the steps I took that resolved the issue on my side. Hopefully, this may help if you encounter a similar problem:

  • Removed and re-added the following .jar files:

    • FNCWebChromeClient.jar

    • JavaScriptHelper.jar

  • Cleaned the output directory using the IDE. However, I noticed that some files were not removed, so I manually deleted the remaining files and performed a full rebuild.

Additionally, I recently migrated my project from Delphi 12 to Delphi 13. It’s possible that changes introduced in the new version or component updates affected the behavior.

As an additional observation before resolving the issue:

  • When generating the QR code on Windows, the background appeared black.

  • On Android, the app was consistently throwing “Exception Error 10” during debugging.

  • I temporarily ignored this error and proceeded with the build. After applying the steps above, the issue was resolved.

At this point, I’m not entirely sure if the issue may occur again, so I wanted to document the steps I took for reference.

Hope this helps.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.