XCode Build Failure - Mach-O Linker Errors- Could not reparse object in bitcode bundle and armv64 not 4-byte aligned

348 views
Skip to first unread message

A Bones

unread,
Jan 3, 2020, 12:53:52 PM1/3/20
to Google Mobile Ads SDK Developers
Hello,

I have a Unity project that built fine on XCode, and once adding GoogleMobileAds it will not build.

I am devloping on 
Windows 10 PC, 
Unity vers 2017.4.301f
I have been successfully compiling 64bit aab files using IL2CPP for several months now, 
Using gradle default builder, not experimental, with no custom gradle template.
I installed GooglePlayGPlugin-0.9.50/. unitypackage
and running Play-services-resolver-1.2.135.0 as well
Both have been working fine, and have successfully compiled 64 bit aab files for Google Play.

Installed GoogleMobileAds v4.1.0.unitypackage

Yesterday, I exported XCode project with GoogleMobile AdsSDK for the first time on this project. 
We transfer and compile on Mac:
  • Mac OS Sierra 10.13.6 running 
  • XCode v10.1 (10B61)

We do not use Cocopods, so we add frameworks manually.
I manually installed the following frameworks for sharing, game center, and ads, we typically 
require these frameworks for GooogleMobileAds.framework to build with our other assets:
  • Gamekit.framework
  • MessageUI.framework
  • Metal.framework
  • Webkit.framework
  • Social.framework
  • CoreLocation.framework
  • AdSupport.framework
  • CoreTelephony.framework
  • GLKit.framework
  • MobileCoreServices.framework
  • Security.framework
  • Storekit.framework

Our workflow lists those as resolving many of the previous Mach-O linker errors for GMAD 3.13.0.

Also, we followed the instructions listed here:

In XCode we added:
  • And added the OtherLinker flags -ObjC
  • And added plist key: GADIsAdManagerApp = bool Yes


For this project we Installed Google IOS SDK 7.53.0
From GoogleMobileAdssdkios-7.53.0.zip file we added the following frameworks:
  • GoogleMobileAds.framework (we're accustomed to this file from GMAds 3.13.1)
  • GoogleAppMeasurement.framework  (new to us)
  • GoogleUtilities.framework (new to us)
  • nanopb.framework (new to us)
We are assuming all 4 frameworks must be included in the XCode project.

We are getting the following build errors:

Ld /Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/TapticalDrone normal arm64

    cd "/Users/andyllora/Desktop/Unity Projects/XCode Projects/Taptical v1.058"

    export IPHONEOS_DEPLOYMENT_TARGET=8.0

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -L/Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -L/Users/andyllora/Desktop/Unity\ Projects/XCode\ Projects/Taptical\ v1.058 -L/Users/andyllora/Desktop/Unity\ Projects/XCode\ Projects/Taptical\ v1.058/Libraries -F/Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -F/Users/andyllora/Desktop/Unity\ Projects/XCode\ Projects/Taptical\ v1.058 -filelist /Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/TapticalDrone.LinkFileList -Xlinker -map -Xlinker /Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/TapticalDrone-LinkMap-normal-arm64.txt -miphoneos-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/TapticalDrone_lto.o -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -Xlinker -final_output -Xlinker /Applications/TapticalDrone.app/TapticalDrone -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_framework CoreMotion -weak-lSystem -ObjC -framework AdSupport -framework GLKit -framework MobileCoreServices -framework GoogleMobileAds -framework StoreKit -framework CoreTelephony -framework Security -framework MessageUI -framework CoreLocation -framework Metal -framework Social -framework WebKit -framework GameKit -framework MediaToolbox -liPhone-lib -framework CoreText -framework AudioToolbox -framework nanopb -weak_framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework MediaPlayer -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -framework GoogleUtilities -liconv.2 -framework GoogleAppMeasurement -lil2cpp -Xlinker -dependency_info -Xlinker /Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/TapticalDrone_dependency_info.dat -o /Users/andyllora/Library/Developer/Xcode/DerivedData/Unity-iPhone-fmyhelcahjsxaecqeozqmlvwgfwg/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/TapticalDrone


ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/andyllora/Desktop/Unity Projects/XCode Projects/Taptical v1.058/Libraries/libiPhone-lib.a(unwind_test_arm64.o)

ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1001.0.46.4.0_0' Reader: '1000.11.45.5_0')', using libLTO version 'LLVM version 10.0.0, (clang-1000.11.45.5)' for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)



Are these 3 new additional frameworks required for base functionality of banners, interstitial, and rewarded ads?
  • GoogleAppMeasurement.framework  (new to us)
  • GoogleUtilities.framework (new to us)
  • nanopb.framework (new to us)

Is this caused by the new version of GoogleMobileAds4.1.0 not being incompatible with our version of XCode 10.1.?

Can anyone please assist in resolving this build error?

Thank you for your time, please let me know if additional information is required.

Mobile Ads SDK Forum Advisor Prod

unread,
Jan 6, 2020, 12:52:16 AM1/6/20
to 54bone...@gmail.com, google-adm...@googlegroups.com
Hi there,

Thank you for providing an extensive rundown of your concern

Since you mentioned that you installed GoogleMobileAds v4.1.0.unitypackage, then all of the required dependencies should be added automatically upon exporting it to iOS project; there is no need for you to add those dependencies you mentioned manually. With this, could you please re-export your Unity project to iOS project again, then immediately build and run it on your device?

Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5001UOFnAT:ref
Reply all
Reply to author
Forward
0 new messages