iOS Build Environment Help Center

Struggling building an ARCore project. FirebaseRemoteConfig error on CocoaPod daemon build.

append delete Liam

Windows version: Windows 11
Builder version: 3.61.1
iOS SDK version: 16.2

Build log:
https://pmbaty.com/paste/?ad3211b6daa860f2#GaECZN1ERMT7mMi5L1zUM6eHCQaaMtnuPNLbtVY3MGke

Verbose build log:
https://pmbaty.com/paste/?aa9fcdbbb5c32f9f#DpkQgthH9hBwX2Spt45qLSLmP5573BakFU4shABhHLMh

CocoaPods daemon build log:
https://pmbaty.com/paste/?d21624c9084e3248#6FaUnKb2qgG22DQQrjoKxdRpdBdNEd7C5Kmr61Wsxxg9

Hello,

I've been trying to build an iOS app based on Google's ARCore Geospatial Unity sample. The project includes a few CocoaPods (from the original Podfile):
pod 'ARCore/CloudAnchors', '~> 1.41.0'
pod 'ARCore/GARSession', '~> 1.41.0'
pod 'ARCore/Geospatial', '~> 1.41.0'
pod 'ARCore/Semantics', '~> 1.41.0'
pod 'Firebase/Analytics', '10.20.0'
pod 'Firebase/Core', '10.20.0'
pod 'Firebase/RemoteConfig', '10.20.0'

Originally I tried building with the CocoaPods daemon without LLVM linker checked, but I was getting errors about missing symbols (see 'CocoaPods daemon build log). Then I tried moving the Podfile to Podfile.bk and manually linking SDK frameworks via 'Add extra framework'. I manually added frameworks (including Firebase, following your instructions with the -objC flag) until I came to these most recent errors.

Are there more frameworks that I'm missing? I feel like I'm starting to make a mess.

I was trying to get pre-built packages for ARCore from this file:
https://github.com/google-ar/arcore-ios-sdk/blob/master/Package.swift
but I got stuck at the dependency:
https://github.com/google/gtm-session-fetcher
since there was no pre-built SDK to use.

Tomorrow I can email you my Unity project and the frameworks I've added. Thank you in advance for reading such a long post.

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

Just to inform you that I received your email and I'm looking at it right now.

append delete #2. Pierre-Marie Baty

I understand the problem. When you build with CocoaPods, your project contains a Pod that uses mixed-language sources, namely the "FirebaseRemoteConfig" pod mixes Swift and Objective-C sources. Xcode builds that using a particular technique, which this builder doesn't replicate yet. Well, time to implement that I guess :-/

Anyway your project must be buildable with the alternate method. I'll now try to build using precompiled binary frameworks and when I succeed I'll tell you the compiler and linker flags to use.

append delete #3. Pierre-Marie Baty

I'm trying to gather the frameworks your project needs. One of these is Google ARCore. Have you read this ?

https://github.com/google-ar/arcore-unity-sdk

Caution: The ARCore SDK for Unity is deprecated, and no longer supported in the 2020 and later versions of Unity. This SDK should only be used by developers working on existing projects which are unable to migrate to Unity's AR Foundation. Developers starting new projects should instead use the ARCore Extensions for AR Foundation.

Can you confirm it's not a mistake and that you do need this SDK ?

append delete #4. Liam

Thanks for working on this and getting back to me.

Before building in Unity, I had imported the Unity packages mentioned [in Google's documentation](https://developers.google.com/ar/develop/unity-arf/getting-started-ar-foundation#ios_1) (ARKit XR Plugin and AR Foundation).

I then added the ARCore Extensions Unity package found [here] (https://github.com/google-ar/arcore-unity-extensions), following [Google's documentation](https://developers.google.com/ar/develop/unity-arf/getting-started-extensions).

All of this was done before building in the Unity Package Manager. I then configured some ARCore Extensions things (enabling Geospatial and Cloud Anchors).

Upon building for iOS from Unity, the Podfile with the dependencies I listed above is generated. I don't believe I'm trying to use the ARCore SDK for Unity, but rather the Podfile calls for various iOS dependencies from the iOS SDK:
https://github.com/google-ar/arcore-ios-sdk

When I found that the ARCore iOS SDK didn't have any pre-built frameworks available for Download, I found this file:
https://github.com/google-ar/arcore-ios-sdk/blob/master/Package.swift
and started downloading the dependencies listed there. Maybe a better way would be to use the Swift Package Manager. I will try that.

Please let me know if I'm not clear or I'm misunderstanding something.

append delete #5. Liam

Whoops, it looks like Markdown style links don't work. Sorry for the messy text.

append delete #6. Pierre-Marie Baty

Okay, my bad. I confused the "Google ARCore Unity SDK" and the "Google ARCore Extensions".

You are totally right, the pre-compiled frameworks for Google ARCore can be downloaded from the URLs given in the Swift package file (Package.swift)

For example to get ARCoreBase.xcframework you can find its download URL here:

% Package.swift
    .binaryTarget(
      name: "ARCoreBase", url: "https://dl.google.com/arcore/swiftpm/1.41.0/Base.zip",
      checksum: "88af8a78467f468e818c82b4c1d45fc751d9013e7f7e4cb5d80d33bd64611b94"
    ),
%

Proceed like this for the rest of the frameworks you need and let me know if you still have problems.

append delete #7. Pierre-Marie Baty

Out of paranoia I decided to build your project so as to see if the builder was unable to build it. It turns out it builds with the following compiler and linker flags:

% compiler flags
-F"EXTRA/arcore-ios-sdk-1.41.0/ARCoreBase.xcframework/ios-arm64"
-F"EXTRA/arcore-ios-sdk-1.41.0/ARCoreCloudAnchors.xcframework/ios-arm64"
-F"EXTRA/arcore-ios-sdk-1.41.0/ARCoreGARSession.xcframework/ios-arm64"
-F"EXTRA/arcore-ios-sdk-1.41.0/ARCoreGeospatial.xcframework/ios-arm64"
-F"EXTRA/arcore-ios-sdk-1.41.0/ARCoreSemantics.xcframework/ios-arm64"
-F"EXTRA/arcore-ios-sdk-1.41.0/ARCoreTFShared.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/FirebaseAnalytics/FirebaseAnalytics.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/FirebaseAnalytics/FirebaseCore.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/FirebaseRemoteConfig/FirebaseRemoteConfig.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/FirebaseAnalytics/nanopb.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/FirebaseAnalytics/FirebaseInstallations.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/FirebaseAnalytics/FirebaseCoreInternal.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/FirebasePerformance/GoogleDataTransport.xcframework/ios-arm64"
-F"EXTRA/Firebase-10.20.0/GoogleSignIn/GTMSessionFetcher.xcframework/ios-arm64"
%
% linker flags
-ObjC
-framework Accelerate
-F"EXTRA/arcore-ios-sdk-1.41.0"
-F"EXTRA/Firebase-10.20.0/FirebaseAnalytics"
-F"EXTRA/Firebase-10.20.0/FirebasePerformance"
-F"EXTRA/Firebase-10.20.0/FirebaseRemoteConfig"
-F"EXTRA/Firebase-10.20.0/GoogleSignIn"
-framework ARCoreBase
-framework ARCoreCloudAnchors
-framework ARCoreGARSession
-framework ARCoreGeospatial
-framework ARCoreSemantics
-framework ARCoreTFShared
-framework FirebaseAnalytics
-framework FirebaseCore
-framework FirebaseRemoteConfig
-framework nanopb
-framework FirebaseInstallations
-framework GTMSessionFetcher
-framework FirebaseCoreInternal
-framework GoogleDataTransport
%

(the -framework Accelerate was a bit pesky to identify as all was needed was a few functions from vecLib.framework which is a sub-framework of it)

The source URLs to download the frameworks were:
https://github.com/google-ar/arcore-ios-sdk for Google ARCore
(pick version 1.41.0 as specified in your Podfile, then download each .xcframework from the "binaryTarget" URLs listed in Package.swift)
https://github.com/firebase/firebase-ios-sdk
(pick version 10.20.0 as specified in your Podfile)

It builds, BUT, it also unveiled a parsing problem in the build script (caused by a cmd.exe limitation and its handling of quotes in strings) -- basically, the compiler flags would be evaluated at the end of the build to decide whether a .dSYM file needed to be created, and the "echo" command caused unwanted dequoting that would break the input of the piped "findstr" command. I worked that around by a little bit of refactoring. The updated build script can be downloaded here:

https://www.pmbaty.com/iosbuildenv/build.cmd.zip

This updated build script will be in version 3.63.

append delete #8. Liam

Thank you so much, especially for going through with the build yourself. I was also able to build using the flags you provided.

Quick note: I had to delete the leftover 'Pods' directory in my build directory. I think it was left from when I tried to build using the CocoaPods daemon. Without deleting, I was getting 'unresolved symbol' errors.

Unfortunately, the app is immediately crashing upon startup.

Here are the logs:
https://pmbaty.com/paste/?49fe4a1ff60b0bc0#22TAGhhq76WS5hFpq4Uv6ybXjiGUvDTAMNp95mmHmSRZ

Following your instructions in another thread about how to read the stack trace, and Googling things such as '(id<MTLCounterSampleBuffer>, unsigned int, unsigned int, MTLCounterResultTimestamp*)', doesn't result in much.

Do you have any ideas?

I also tried building a simpler AR demo scene and the app crashes with the same error, leading me to believe that the scene is not the problem.

I also checked the Unity ARCore Extensions GitHub to no avail.

If this is beyond the scope of iOS Builder support, just let me know and I'll try to figure this out on my own.

append delete #9. Pierre-Marie Baty

That's interesting. The crash is a SIGSEGV (segmentation violation, i.e. out of bounds memory access), was caught by __sig_handler() to display this very crash log (stack level 0), actually occurred thus in libSystem_Platform.dylib (stack level 1) and was triggered by a call to metal::ResolveTimestampCounters() with certainly invalid parameters at stack level 2 at the bottom of a series of operator delete[]s which are typical from the destruction of some object with deeply structured children.

Unfortunately there's no information on metal::ResolveTimestampCounters() on the Apple public web, so this must be a private API.

At this point I'd advise to look at the iOS system logs (that you can collect over USB) while the crash happens, something relevant will hopefully be printed to explicit the real cause.

append delete #10. shea

Hello @Liam. I am also attempting to build an ARCore project for iOS. Is this a fool's errand? Or did you get it to build and run in the end?

append delete #11. Pierre-Marie Baty

Hello @shea. I don't know if I can talk on behalf of others here, but I _think_ I would have received a lot of error feedback if that was definitely not possible. If you have a problem you can't solve by yourself, create a new thread and I'll help you the best I can.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty