iOS crash on launch

59 views
Skip to first unread message

Ken

unread,
Aug 14, 2025, 8:06:11 AM8/14/25
to Google Mobile Ads SDK Developers
I'm trying to integrate Google Mobile Ads in Unreal Engine targeting iOS and getting a crash on launch before any of my code is executed (Android runs and invokes ads just fine). Here is the relevant version info:
  • Google Mobile Ads SDK - 12.9.0
  • XCode - 16.4
  • OSX 15.5
  • iOS SDK - 18.6
  • Unreal Engine - 5.6
  • Device - iPhone 13 mini
  • Device OS - 18.6
My Info.plist definitely has the correct app ID in GADApplicationIdentifier and the array of SKAdNetworkItems entries from your setup.

The crash appears to involve sqlite trying to open a database and perhaps involves the initialization of an object called GADSettings.

#0 0x0000000000000000 in 0x00000000 ()
#1 0x000000010cfea6ec in sqlite3Malloc ()
#2 0x000000010cffe740 in openDatabase ()
#3 0x00000001041e474c in ___lldb_unnamed_symbol1466021 () <--- This is where the below assembly is coming from, which appears to be your SDK code
#4 0x00000001041e449c in ___lldb_unnamed_symbol1466017 ()
#5 0x00000001041e4378 in ___lldb_unnamed_symbol1466016 ()
#6 0x000000011c402064 in _dispatch_client_callout ()
#7 0x000000011c3eb6d0 in _dispatch_once_callout ()
#8 0x00000001041e4358 in ___lldb_unnamed_symbol1466015 ()
#9 0x00000001041caebc in ___lldb_unnamed_symbol1465463 ()
#10 0x000000011c3e8584 in _dispatch_call_block_and_release ()
#11 0x000000011c402064 in _dispatch_client_callout ()
#12 0x000000011c420e58 in _dispatch_queue_override_invoke ()
#13 0x000000011c3fbf30 in _dispatch_root_queue_drain ()
#14 0x000000011c3fc8c8 in _dispatch_worker_thread2 ()
#15 0x000000021dbec9d0 in _pthread_wqthread ()

    0x1041e46e0 <+28>:  bl     0x1041e3fd4               ; GADGoogleMobileAdsSupportDirectoryURL
    0x1041e46e4 <+32>:  mov    x29, x29
    0x1041e46e8 <+36>:  bl     0x10bcd6820               ; objc_retainAutoreleasedReturnValue.island
    0x1041e46ec <+40>:  mov    x20, x0
    0x1041e46f0 <+44>:  adrp   x2, 54130
    0x1041e46f4 <+48>:  add    x2, x2, #0x758            ; @"Settings"
    0x1041e46f8 <+52>:  bl     0x10bcd35cc               ; objc_msgSend$URLByAppendingPathComponent:.island
    0x1041e46fc <+56>:  mov    x29, x29
    0x1041e4700 <+60>:  bl     0x10bcd6820               ; objc_retainAutoreleasedReturnValue.island
    0x1041e4704 <+64>:  mov    x19, x0
    0x1041e4708 <+68>:  mov    x0, x20
    0x1041e470c <+72>:  bl     0x10bcd682c               ; objc_release.island
    0x1041e4710 <+76>:  cbz    x19, 0x1041e4768          ; <+164>
    0x1041e4714 <+80>:  mov    x0, x19
    0x1041e4718 <+84>:  bl     0x10bcd5238               ; objc_msgSend$path.island
    0x1041e471c <+88>:  mov    x29, x29
    0x1041e4720 <+92>:  bl     0x10bcd6820               ; objc_retainAutoreleasedReturnValue.island
    0x1041e4724 <+96>:  mov    x22, x0
    0x1041e4728 <+100>: bl     0x10bcd3e78               ; objc_msgSend$copy.island
    0x1041e472c <+104>: mov    x20, x0
    0x1041e4730 <+108>: mov    x0, x22
    0x1041e4734 <+112>: bl     0x10bcd682c               ; objc_release.island
    0x1041e4738 <+116>: mov    x0, x20
    0x1041e473c <+120>: bl     0x10bcd35f4               ; objc_msgSend$UTF8String.island
    0x1041e4740 <+124>: str    xzr, [sp, #0x28]
    0x1041e4744 <+128>: add    x1, sp, #0x28
    0x1041e4748 <+132>: bl     0x10bcd336c               ; sqlite3_open.island <--- This is where it crashes
->  0x1041e474c <+136>: cbz    w0, 0x1041e4770           ; <+172>
    0x1041e4750 <+140>: adrp   x1, 54128
    0x1041e4754 <+144>: add    x1, x1, #0x298            ; @"Couldn't open database."
    0x1041e4758 <+148>: mov    x0, #0x0                  ; =0
    0x1041e475c <+152>: bl     0x10412b560               ; GADPostErrorEvent

For what it's worth, this would be far easier to debug if you published the source code to the SDK. If it's somewhere I'm not aware of, please let me know. In either case, please let me know how I can resolve this issue.

Best,
Ken


Mobile Ads SDK Forum Advisor

unread,
Aug 14, 2025, 2:18:56 PM8/14/25
to k...@candlelight.games, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support Team.

According to the Google Mobile Ads SDK documentation, we support the following platforms: Android, iOS, Unity and Flutter. Currently, the Google Mobile Ads (GMA) SDK does not have an official support  for Unreal Engine. 

Could you confirm whether the mentioned issue is reproduced in our Google sample application?  If yes please share the following details privately with us for further investigation:

  • Steps to reproduce the issue in Google sample project
  • If no, please share your sample application and full crash logs where the issue is reproducible

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files via reply to author option or by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=500Ht00001sz6DBIAY&entry.80707362=00329956

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 

Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-08-14 18:18:05Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01sz6DB:ref" (ADR-00329956)



Ken

unread,
Aug 17, 2025, 7:32:24 AM8/17/25
to Google Mobile Ads SDK Developers
I have identified that this is an issue in Google Mobile Ads' usage of SQLite and how it gets linked in Unreal Engine. I worked around it locally, but a fix on the Google side would be much better.

The issue is that Google Mobile Ads is making an openDatabase() call into SQLite and assuming that all API calls will automatically initialize the library. However, you can disable auto-initialization using the SQLITE_OMIT_AUTOINIT compiler flag. Unreal Engine does this, and instead calls sqlite3_initialize() on module load early in its initialization. This make sense and works great in normal UE code because the module is loaded earlier than any game code. The problem is the Google Mobile Ads seems to execute code way before that when included as an embedded framework (perhaps there's some hook when the framework is first dynamically loaded?). Unreal Engine has not run any module initialization, so sqlite3_initialize() was not called yet and it crashes trying to call a function pointer set in initialization.

The fix is very simple. Do not assume automatic initialization. Instead just call sqlite3_initialize() manually. It's OK to call it multiple times because it does nothing if already initialized.

Best,
Ken

Ken

unread,
Aug 17, 2025, 7:32:27 AM8/17/25
to Google Mobile Ads SDK Developers
I have already fixed this issue and replied with the suggested bug fix on your end, but the approval process on this forum is painfully slow and apparently you're not able to see the second message here. The fix is for you to run sqlite3_initialize() before you call any SQLite code. Since you're not in control of the SQLite dependency, you can't assume it's compiled with auto-initialization. This is not an Unreal Engine issue. This would happen in any build environment where you aren't in control of how SQLite is compiled.

Again, we aren't blocked by this and it's only an annoyance in our build structure now. So, I'm not going to spend effort on building your test app. We are successfully viewing test ads on both iOS and Android now.

Best,
Ken

Mobile Ads SDK Forum Advisor

unread,
Aug 18, 2025, 8:11:18 AM8/18/25
to k...@candlelight.games, google-adm...@googlegroups.com

Hi,

Thank you for getting back to us.
At present , we do not have a sample project that includes an SQLite implementation. Since you mentioned that the ads are loading successfully, if the issue continues, we kindly request you to share your sample project which replicates the issue with SQLite implementation. This will help us to investigate further and provide you with more accurate guidance.


Kindly provide the requested details via Reply privately to author option 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=500Ht00001sz6DBIAY&entry.80707362=00329956

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.


Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-08-18 12:10:07Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01sz6DB:ref" (ADR-00329956)



Reply all
Reply to author
Forward
0 new messages