"Class TForm1 not found" upon launching Delphi Android app. App works fine

Viewed 118

I've made a simple Android app in Delphi which creates a login form. The issue I'm having is that when I run it on Android phone, the app starts fine, but pops up a message "Class TFormLogin not found" (approx 100ms after FormLogin is already shown). Despite the FormLogin being created and working as intended. When I click ok the message goes away and the app continues to work normally.

enter image description here

What does the message "Class TFormLogin not found" mean and how to make it go away?

P.S. Since I've already found the cause. Culprit of the error was usage of StyleBook in the project.


As requested, here's MCVE. The error appears in new blank multi-platform project without any code added in the PAS or DPR. This FMX form setup is enough:

object Form1: TForm1
  StyleName = 'bg'
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 480
  ClientWidth = 640
  StyleBook = StyleBook1
  StyleLookup = 'bg'
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [Desktop]
  DesignerMasterStyle = 0
  object StyleBook1: TStyleBook
    Styles = <
      item
      end>
    Left = 304
    Top = 224
  end
end
1 Answers

This came out to be StyleBook error message (wording should have been more descriptive, right).

The error was caused by TFormLogin having a StyleBook and StyleLookup and StyleName references specified in FMX, wheres StyleBook did not had the corresponding style StyleName in it.

P.S. What puzzles me, when either StyleLookup or StyleName is clear, code works fine. When both are filled - error message appears.

Related