Jump to content
Sign in to follow this  
Vanar

Problem using the unit FireDAC.Phys.SQLiteWrapper.Stat in AdMob under Delphi 11 and 12

Recommended Posts

Posted (edited)

I tested Kastri-master\Demos\AdMob.
Advertising works perfectly in both iOS and Android!

But when I try to use this mechanism in my iOS application, the application does not start (crashes on startup)
Everything works well under Android.

After a long search for the error, it turned out that the culprit is the unit FireDAC.Phys.SQLiteWrapper.Stat, which is used in my application!
I can’t give up the unit FireDAC.Phys.SQLiteWrapper.Stat, since I’ll have to rewrite everything.

The problem is described in https://en.delphipraxis.net/topic/6440-firebase-adertising-problem-after-ios-14/
and the same thing happens to me

How to check (see the error):
If you add the unit FireDAC.Phys.SQLiteWrapper.Stat to Kastri-master\Demos\AdMob\Unit1.pas, the iOS application does not launch (crashes on startup)

Are there ways to fix the error?

Edited by Vanar

Share this post


Link to post
Posted (edited)

I had the same problem in an own application, and with Kastri FCMRebooted demo. I just removed FireDAC.Phys.SQLiteWrapper.Stat, and then FireDAC uses dynamic linking, and probably uses the native sqlite3 dylib. The database still works.

ChatGPT suggested using TFDPhysSQLiteDriverLink.Create(nil).VendorLib := ''; to use the native library, but that didn't help with statical linking.

Another option would to edit the linking of the static library in the unit, to use the iOS native lib.

EDIT: on Android, you have to use the SQLiteWrapper.Stat unit, or deploy the dynamic lib..

 

Edited by PetrifiedDelhpi
Add info

Share this post


Link to post
On 8/2/2024 at 10:09 PM, PetrifiedDelhpi said:

I had the same problem in an own application, and with Kastri FCMRebooted demo. I just removed FireDAC.Phys.SQLiteWrapper.Stat, and then FireDAC uses dynamic linking, and probably uses the native sqlite3 dylib. The database still works.

ChatGPT suggested using TFDPhysSQLiteDriverLink.Create(nil).VendorLib := ''; to use the native library, but that didn't help with statical linking.

Another option would to edit the linking of the static library in the unit, to use the iOS native lib.

EDIT: on Android, you have to use the SQLiteWrapper.Stat unit, or deploy the dynamic lib..

 

Thanks for the answer, but can you explain in more detail or maybe you have a ready-made module?

"- Another option would to edit the linking of the static library in the unit, to use the iOS native lib."

Share this post


Link to post
On 8/5/2024 at 9:30 AM, Vanar said:

Thanks for the answer, but can you explain in more detail or maybe you have a ready-made module?

"- Another option would to edit the linking of the static library in the unit, to use the iOS native lib."

I tried to go that way before I realized that FireDAC.Phys.SQLiteWrapper.Stat is totally unnecessary on iOS. I don't have Delphi at home, but there are somewhere in the units or inc files the linking of the static library used by Delphi. Delphi can also link statically to a "dynamic" library if it is available, at least on Windows.

http://docwiki.embarcadero.com/RADStudio/Athens/en/Connect_to_SQLite_database_(FireDAC)

btw, I
don't believe that the dynamic linking of the proprietary iOS lib works, although it is mentioned on that page

Share this post


Link to post
3 hours ago, PetrifiedDelhpi said:

I tried to go that way before I realized that FireDAC.Phys.SQLiteWrapper.Stat is totally unnecessary on iOS. I don't have Delphi at home, but there are somewhere in the units or inc files the linking of the static library used by Delphi. Delphi can also link statically to a "dynamic" library if it is available, at least on Windows.

http://docwiki.embarcadero.com/RADStudio/Athens/en/Connect_to_SQLite_database_(FireDAC)

btw, I
don't believe that the dynamic linking of the proprietary iOS lib works, although it is mentioned on that page

Thank you very much

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
Sign in to follow this  

×