Build failed after only added Admob SDK. Is there anyone can tell me what "_sqlite3_prepare_v3" is?

355 views
Skip to first unread message

Kim Benjamin

unread,
Apr 28, 2020, 2:40:42 AM4/28/20
to Google Mobile Ads SDK Developers
Hello everyone.

I have a problem while applying Admob SDK to my iOS App.

I'm only added next 4 Admob SDK frameworks. 

GoogleAppMeasurement.framework
GoogleMobileAds.framework 
GoogleUtilities.framework 
nanopb.framework

And I never did any other works.
But build is failed with Apple Mach-O Linker Error.

next is the message

"_sqlite3_prepare_v3", referenced from: -[APMSqliteStore prepareSQL:error:] in GoogleAppMeasurement(APMSqliteStore_some_message.o)


Symbol(s) not found for architecture x86_64


Linker command failed with exit code 1 (use -v to see invocation)



Could you please anyone can help me?

I did everything I could find via google until now.


Mobile Ads SDK Forum Advisor Prod

unread,
Apr 28, 2020, 6:17:22 AM4/28/20
to bkwo...@gmail.com, google-adm...@googlegroups.com
Hi Kim,

Thank you for reaching out to us. 

Are you importing the Mobile Ads SDK manually? If so, would it be possible for you to import the SDK through pod instead? 

Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5001UaScG4:ref

Kim Benjamin

unread,
Apr 28, 2020, 9:04:43 AM4/28/20
to Google Mobile Ads SDK Developers
Hi Pimentel. 
Thank you for answer my question.

I imported it manually.

For complicated to explain reason, I would like to import it as manually as possible.
But, If there is no other way except using the pod, i will import it via pod.

By the way, What's the difference between manual import and pod?



2020년 4월 28일 화요일 오후 7시 17분 22초 UTC+9, mobileadssdkforumadvisor 님의 말:

Mobile Ads SDK Forum Advisor Prod

unread,
Apr 28, 2020, 10:41:45 AM4/28/20
to bkwo...@gmail.com, google-adm...@googlegroups.com
Hi Kim,

I am on TeeJay's team. I just did a manual install of an iOS banner app following instructions posted here and it ran well. 

There are many benefits to using pods such as automatic settings(plist entries, compiler flags....) and easy updates etc..

I found an interesting stackoverflow article that may help you as it seems to be addressing the problem you are having. GoogleAppMeasurement is used by many products.

If you can give us a bare bones step by step way to replicate your problem we may be able to help you.

Regards,
Aryeh Baker

Kim Benjamin

unread,
Apr 28, 2020, 11:59:24 PM4/28/20
to google-adm...@googlegroups.com
Hi Baker.
Thank you for answer.

The article is already referenced.

It works perfectly when i created a new project. But not work in our project.

Actually i tried pod yesterday. But, using pod occured other problem.
Our project has 4 different build targets.
I don't know exactly it cause or not, but it didn't work.

When pod install, it shows below messages for each target. (so many messages)
-----
CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `OURPROJECT_Beta` to `Target Support Files/Pods-OURPROJECT_Beta/Pods-OURPROJECT_Beta.beta_debug.xcconfig` or include the `Target Support Files/Pods-OURPROJECT_Beta/Pods-OURPROJECT_Beta.beta_debug.xcconfig` in your build configuration (`Configuation/BETA.xcconfig`).

[!] The `OURPROJECT_Beta [RC_DEBUG]` target overrides the `GCC_PREPROCESSOR_DEFINITIONS` build setting defined in `Pods/Target Support Files/Pods-OURPROJECT_Beta/Pods-OURPROJECT_Beta.rc_debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `OURPROJECT_Beta [RC_DEBUG]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-OURPROJECT_Beta/Pods-OURPROJECT_Beta.rc_debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `OURPROJECT_Beta [RC_DEBUG]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-OURPROJECT_Beta/Pods-OURPROJECT_Beta.rc_debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

-----

Our project is working with 10 or more people. And we have several build environment. So, for using(or applying) pod, there are many things to consider.

I think it relateted GoogleAppMeasurement.framework.
Build is success when i remove that framework. But at this case,  other runtime error  occured. 
All i want at this time is that i want to know what "_sqlite3_prepare_v3" is?

Because xcode shows  below message as i sent it first time. It is not our symbol.
-----
Undefined symbols for architecture x86_64: "_sqlite3_prepare_v3", referenced from: -[APMSqliteStore prepareSQL:error:] in GoogleAppMeasurement(APMSqliteStore_1e4736e834208ded6c04f0471e407ef5.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 warnings only
-----

I'm still trying pod until now, it's not work yet.





2020년 4월 28일 화요일 오후 11시 41분 45초 UTC+9, mobileadssdkforumadvisor 님의 말:

Mobile Ads SDK Forum Advisor Prod

unread,
Apr 29, 2020, 4:25:46 AM4/29/20
to bkwo...@gmail.com, google-adm...@googlegroups.com
Hi Kim,

Thank you for providing rundown of the issue. Could you please provide a project (or at least a sample project) where the issue is reproducible so we could see the issue on our end as well? You may upload the project on your Google Drive, then provide to us the shareable link via Reply privately to author option.

Regards,
Teejay Pimentel

Kim Benjamin

unread,
Apr 29, 2020, 5:31:41 AM4/29/20
to Google Mobile Ads SDK Developers
Hi Pimentel,

Unfortunately, I don't have any authority to provide it.
My company owns.

Our project uses "libsqlite3.a".
The error message contains "_sqlite3_prepare_v3"
Is it have any possibility(relation?) of this error?

By the way, Do you have any reason that you don't tell me about what "_sqlite3_prepare_v3" is?


2020년 4월 29일 수요일 오후 5시 25분 46초 UTC+9, mobileadssdkforumadvisor 님의 말:

Mobile Ads SDK Forum Advisor Prod

unread,
Apr 29, 2020, 7:24:37 AM4/29/20
to bkwo...@gmail.com, google-adm...@googlegroups.com
Hi Kim,

The "_sqlite3_prepare_v3" error seems to be related to SQLite, which I'm afraid isn't quite related to the AdMob SDK directly. I'm afraid that I'll be needing additional data in order to investigate on why this error occurs. With that said, could you please provide/confirm the following details?
  • SDK version where the issue occurs
  • XCode version
  • Have you tried other version of the SDK? If so, is the issue still exists?

Kim Benjamin

unread,
Apr 29, 2020, 9:27:25 PM4/29/20
to google-adm...@googlegroups.com
Hi Pimentel.

of course i can provide details.

- Mac OS Mojave 10.14.6
- SDK version where the issue occurs : 7.56.0
- XCode version : 11.3.1
- Have you tried other version of the SDK? If so, is the issue still exists? 
7.57.0 has same problem. 
7.58.0 looks some change. Two of files filename extension is changed(framework -> xcframework). 

At first time, This version shows different error message.
"error: the use of xcframeworks is not supported in the legacy build system."

but i changed build setting and try again, it shows same message as below

"Undefined symbol: _sqlite3_prepare_v3"


Can i have an old version SDK? I want test but i can't find it.


2020년 4월 29일 수요일 오후 8시 24분 37초 UTC+9, mobileadssdkforumadvisor 님의 말:

Mobile Ads SDK Forum Advisor Prod

unread,
Apr 30, 2020, 3:35:54 AM4/30/20
to bkwo...@gmail.com, google-adm...@googlegroups.com
Hi Kim,

Thank you for providing the requested details. Let me raise this (including the reports findings and discussion thus far) to the rest of the team to get their insight as well. I'll get back to you the soonest they provide their feedback.

On the other hand, you may download the old SDK by specifying the version on the pod file. Since you are importing the SDK manually, I'll ask this to the team as well.

Kim Benjamin

unread,
May 1, 2020, 2:53:21 AM5/1/20
to Google Mobile Ads SDK Developers
This is additional informations.

When i removed "GoogleAppMeasurement.framework" and then build, it success.
But it occurs runtime error.


2020년 4월 30일 목요일 오후 4시 35분 54초 UTC+9, mobileadssdkforumadvisor 님의 말:

Mobile Ads SDK Forum Advisor Prod

unread,
May 1, 2020, 1:38:08 PM5/1/20
to bkwo...@gmail.com, google-adm...@googlegroups.com

Hello,

Regarding the use of xcframeworks error, you can try turning off the legacy build system. Go to File -> Workplace Settings -> Build System -> Change to New Build System (Default).
Regarding the use of older versions of our SDK, you can find a list of podspecs at https://github.com/CocoaPods/Specs/tree/master/Specs/5/9/a/Google-Mobile-Ads-SDK.  In each podspec you will see the line (see attached screenshot):

"source": {
    "http": "https://dl.google.com/dl/cpdc/0c10c95bd100a047/Google-Mobile-Ads-SDK-7.58.0.tar.gz"
  },

This is the download URL for the given version of the SDK.

Have you also added '-ObjC' to the Other Linker Flags setting in your project build settings as per the documentation ?

If you could try the above steps and let us know your findings.

Thanks
 

Sam
Mobile Ads SDK support team



ref:_00D1U1174p._5001UaScG4:ref
Screen Shot 2020-05-01 at 10.31.41 AM.png

Kim Benjamin

unread,
May 1, 2020, 11:36:25 PM5/1/20
to Google Mobile Ads SDK Developers
Hello.
Thank you for reply.

I found how to download previous version of Google ADMob SDK via cocoapod. And i found it also how to download each frameworks to previous version.
I made an empty project and downloaded it. 
But I'm not sure it is right way or not. (Is it one of right way to download?)

I tested change build system to "New build system", error message is same as before. 

스크린샷 2020-05-02 오전 12.19.11.png

(Legacy build system message)



스크린샷 2020-05-02 오후 12.01.19.png

(New build system message)


I checked -ObjC flag many times. I always checked it first after add frameworks.


I think our project conflict with "GoogleAppMeasurement" or "GoogleUtility" framework not "Google-Mobile-Ads-SDK" framework issues.. Because when i change these frameworks previously version, it cause other error messages.

Anyway i don't know why it occurs error that i didn't do anything except add framework.


Thanks




2020년 5월 2일 토요일 오전 2시 38분 8초 UTC+9, mobileadssdkforumadvisor 님의 말:

Kim Benjamin

unread,
May 3, 2020, 4:34:01 AM5/3/20
to google-adm...@googlegroups.com
Hello,

I found the way to build success. But i'm not sure it's right way or not.

I copied "Other Linker Flags" from "MediationExample"'s one to our project.
And build is success.

Other Linker Flags of MediationExample : $(inherited) -l"c++" -l"sqlite3" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreVideo" -framework "MediaPlayer" -framework "MessageUI" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration")

Above flag doesn't contains -ObjC flag.
So i tested it just remove -ObjC flag in our project. And then build was succeed.

But it's weird. When i make an empty project, it doesn't work without -ObjC flag.

Can you tell me what -ObjC flags does to ADMob SDK?
I don't know what is difference between "MediationExample" project and my custom project. build setting or what?

By the way, remove "-objc" flag make other problems.
Our app applied Vungle, Adjust, Grwothy SDKs.
These SDKs have problem after -objc flag is removed.

What am i need to do for apply ADMob SDK?




2020년 5월 2일 토요일 오후 12시 36분 25초 UTC+9, Kim Benjamin 님의 말:

Mobile Ads SDK Forum Advisor Prod

unread,
May 4, 2020, 11:30:58 AM5/4/20
to bkwo...@gmail.com, google-adm...@googlegroups.com
Hi,

Glad you were able to get it working. I think you found something relevant, looking at the GoogleAppMeasurement podspec there are 3 libraries listed,     "c++", "sqlite3", and "z".  Therefore -l"c++" -l"sqlite3" -l"z" are needed in your linker flags.

In regards to the `-ObjC` flag, it's required for the Google Mobile Ads SDK, you can find docs on
this page :

The -ObjC Linker Flag
Passing the -ObjC option to the linker causes it to load all members of static libraries that implement any Objective-C class or category. This will pickup any category method implementations. But it can make the resulting executable larger, and may pickup unnecessary objects. For this reason it is not on by default.



Let me know if you have further queries.

Regards

Sam
 

ref:_00D1U1174p._5001UaScG4:ref

Mobile Ads SDK Forum Advisor Prod

unread,
May 4, 2020, 11:38:11 AM5/4/20
to bkwo...@gmail.com, google-adm...@googlegroups.com
By the way, are you able to reproduce this issue in any of our sample apps? I tried manually linking all 4 frameworks and adding `-ObjC` linker flag to our InterstitialExample and the app launched and ran successfully on the simulator using XCode 11.4.1 and an iOS 13 simulator.

ref:_00D1U1174p._5001UaScG4:ref

Kim Benjamin

unread,
May 6, 2020, 3:56:52 AM5/6/20
to Google Mobile Ads SDK Developers
Hi, 

Technically, it's not working. 
It is just build success.

You can find what problem is at first of this conversations.
Remove -ObjC flags occurs many other problems.

as i tell you before, sample project is no problem. 
pod, manual anything is ok.

But it's not working with "-ObjC" flag until now.



2020년 5월 5일 화요일 오전 12시 30분 58초 UTC+9, mobileadssdkforumadvisor 님의 말:

Mobile Ads SDK Forum Advisor Prod

unread,
May 6, 2020, 12:35:41 PM5/6/20
to bkwo...@gmail.com, google-adm...@googlegroups.com

I've read the initial issue is this:

*"_sqlite3_prepare_v3", referenced from: -[APMSqliteStore
prepareSQL:error:] in GoogleAppMeasurement(APMSqliteStore_some_message.o)*

*Symbol(s) not found for architecture x86_64*

Does adding the flags: 
-l"c++" -l"sqlite3" -l"z" to your Other Linker Flags (as well as -ObjC) not solve the issue?

If you would be able to provide a sample project which reproduces the issue we would be able to help you further. Since it doesn't reproduce on our sample apps it sounds like it may be an issue specific to your project.

Regards

 

Reply all
Reply to author
Forward
0 new messages