xcodeunity-game-enginecocoapodsunityads

Undefinded symbol: _OBJC_CLASS_$_UnityAds in XCode, when i try to archive a unity ios project


i want to archive an unity ios project in xcode to upload it to the appstore. While archiving, i get the following two errors:

Undefined symbol: OBJC_CLASS$_UnityAds

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

The full error text ist here:

Ld /Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework normal (in target 'UnityFramework' from project 'Unity-iPhone')
    cd /Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Xlinker -reproducible -target arm64-apple-ios12.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk -Os -L/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/EagerLinkingTBDs/Release-iphoneos -L/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/usr/lib/swift -L/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Libraries -L/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Libraries/Plugins/iOS -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/EagerLinkingTBDs/Release-iphoneos -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/GoogleUtilities -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/PromisesObjC -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/Protobuf -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/nanopb -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/GoogleAppMeasurement/Frameworks -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/GoogleUserMessagingPlatform/Frameworks/Release -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/UnityAds -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/UnityMediationAdapter -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/UnityMediationLogging -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/UnityMediationSdk -F/Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Pods/UnityMediationUnityAdapter -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/Google-Mobile-Ads-SDK -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement/AdIdSupport -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement/WithoutAdIdSupport -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/GoogleUserMessagingPlatform -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/UnityAds -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/UnityMediationAdapter -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/UnityMediationLogging -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/UnityMediationSdk -F/Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/UnityMediationUnityAdapter -filelist /Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework.LinkFileList -install_name @rpath/UnityFramework.framework/UnityFramework -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -Xlinker -map -Xlinker /Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/UnityFramework-LinkMap-normal-arm64.txt -dead_strip -Xlinker -object_path_lto -Xlinker /Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_lto.o -stdlib\=libc++ -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -lsqlite3 -lz -framework AVFAudio -framework AVFoundation -framework AdSupport -framework AppTrackingTransparency -framework AudioToolbox -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreMedia -framework CoreTelephony -framework CoreVideo -framework FBLPromises -framework Foundation -framework GoogleAppMeasurement -framework GoogleAppMeasurementIdentitySupport -framework GoogleMobileAds -framework GoogleUtilities -framework MediaPlayer -framework MessageUI -framework MobileCoreServices -framework Network -framework Protobuf -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -framework UIKit -framework UnityAds -framework UnityMediationAdapter -framework UnityMediationLogging -framework UnityMediationSdk -framework UnityMediationUnityAdapter -framework UserMessagingPlatform -framework WebKit -framework nanopb -weak_framework AdSupport -weak_framework JavaScriptCore -weak_framework SafariServices -weak_framework WebKit -weak_framework CoreMotion -weak-lSystem -liPhone-lib -framework Metal -framework Security -framework MediaToolbox -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework AVKit -framework CFNetwork -framework CoreGraphics -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework OpenAL -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp /Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Libraries/baselib.a /Users/macbookpro/Desktop/Projekte/Gym/Gym_0_0_9/Libraries/Plugins/iOS/unity-plugin-library.a -weak_framework GameController -framework Pods_UnityFramework -Xlinker -dependency_info -Xlinker /Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_dependency_info.dat -o /Users/macbookpro/Library/Developer/Xcode/DerivedData/Unity-iPhone-bwgxquphgntexaaskcghcrqzasat/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework

ld: warning: ignoring duplicate libraries: '-lc++'
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: warning: Could not find or use auto-linked framework 'UnityMediationInstantiationService': framework 'UnityMediationInstantiationService' not found
ld: warning: Could not find or use auto-linked framework 'UnityMediationS2SService': framework 'UnityMediationS2SService' not found
ld: warning: Could not find or use auto-linked framework 'UnityMediationTrackingService': framework 'UnityMediationTrackingService' not found
ld: warning: Could not find or use auto-linked framework 'UnitySwiftProtobuf': framework 'UnitySwiftProtobuf' not found
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_UnityAds", referenced from:
       in UnityMediationUnityAdapter[arm64][6](UMSUnityAdsAdapterFactory.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This was my workflow:
I try to upload my unity project to the Apple app Store. So i build the prject for ios.
On my Macbook iopened the prject in terminal and enter this command: pod install --repo-update I need to do this, because i want to use google Admob. After that, i opened the Unity-iPhone.xcworkspace file, enter my signing, adjust the iOS Deployment Target of my pods and start to archive it. After a few moments i got this errors.

I think it is strange, because i dont want to use the UnityAds and did deactivate it in unity.


Solution

  • I solved the problem by deleting all files from my project that contained "mediation" or "unityAds".