I have this project with multiple iOS targets. Each target has its own AppDelegate.h
and AppDelegate.m
which inherits from either AppDelegateBase
or AppDelegateServiceBase
. I am using Xcode 13.4.1 - the build works fine but archive fails. For Xcode 12.x, this works just fine.
The moment I try to archive, it resolves to wrong header from a different target but same name and naturally gives error because of difference in imports.
Any idea how to fix this?
I use xcodebuild -project client/Onyz.xcodeproj -scheme IQW -configuration DEBUG -sdk iphoneos15.5 archive
… this gives me error as the path for a file referring to AppDelegate resolves to target IMW (which is the other target). Part of logs are below. Initially this problem was extending to build
command as well, but changing from -target
to -scheme
fixed it. This pattern of failure holds across xcodebuild and Xcode but limited to 13 and above.
In file included from /Volumes/ZX_2TB_SSD/j1/workspace/Onyz/client/iOS/WebBrowserMenuViewController.m:19: In file included from /Volumes/ZX_2TB_SSD/j1/workspace/Onyz/client/iOS/Targets/IMW/AppDelegate.h:10: In file included from /Volumes/ZX_2TB_SSD/j1/workspace/Onyz/client/iOS/AppDelegateServiceBase.h:20: In file included from /Volumes/ZX_2TB_SSD/j1/workspace/Onyz/client/iOS/SDK/AdSupport/AotAdWindow.h:10: /Volumes/ZX_2TB_SSD/j1/workspace/Onyz/client/iOS/SDK/AdSupport/AotAdNetworkManager.h:13:9: fatal error: 'GoogleMobileAds/GoogleMobileAds.h' file not found #import <GoogleMobileAds/GoogleMobileAds.h>
On 2nd line - instead of IMW, it should be IQW and after that the rest of header resolution chain will change.