Could not resolve reference for target 'Toffee-iOS' (Simulator)

It seems to be the sdk ?

TargetsMatch? Moshine.Api.Location/Toffee.iOS vs EverythingApp/Toffee-iOS : False
    why not?
    t.SubMode 
    ot.SubMode iOS
    t.SDK iOS
    ot.SDK iOS 15.5
 

The ios app is 15.5, I changed it to ios and it built

Curious. SDK should be only the name, not the version.

but: ah damn: this gets propagated from the main project and I changed that, because I didnā€™t have the right Xcode active for 15.5. That means I can probably reproduce this issue now, if I set it back. lets seeā€¦

Reproduced and fixed. But really, your problem is that you have Toffee targets with no SubMode set, which is wrong. You should set <SubMode>iOS</SubMode> for the two projects that fail.

I dont think I have submode in any of my toffee targets. Like this ?

  <PropertyGroup Condition=" '$(Target)' == 'Toffee.iOS' ">
    <Mode>Toffee</Mode>
    <SDK>iOS</SDK>
    <SubMode>iOS</SubMode>
    <SupportMacCatalyst>False</SupportMacCatalyst>
    <DefaultUses>Foundation;RemObjects.Elements.Linq</DefaultUses>
    <GenerateBitcode>True</GenerateBitcode>
    <Architecture>all</Architecture>
    <SimulatorArchitecture>all</SimulatorArchitecture>
  </PropertyGroup>

Yeah. what caused some to work is that you have this dependency chain (simplified, and I might get the names crossed):

  • Everything
    • Foundation
    • Location
      • Foundation
    • Weather

So what happens is: Location as ā€œiOSā€ as SDK. Since it uses Foundation, Foundation gets updated to also have ā€œiOSā€ as SDK, and since no SubMode is set, it falls back to SDK, and all is good.

Then Weather is used by Everything, which has ā€œiOS 15.5ā€ as SDK, so the SDKs donā€™t match (and SubMode is set on Everything, but not on Weather, so also doesnā€™t match), so no two matching targets are found, and so Build Destinations (Sim vs Devie vs Mac Catalyst) and Architectures do not get set to match.

I have fixed this to be more lenient and consider ā€œiOS 15.5ā€ and ā€œiOSā€ a match, by only looking at the SDK Name (which really is the right thing to do), so you should be good. But having SubMode set properly would have avoided this and, for Toffee, still is the proper thing to do (even though the rest of the toolchain compensates and handles it of only SubMode or SDK are setā€¦

This is all a bit grown/legacy. If I was creating the Toffee toolchain from scratch right now, thereā€™d be no SubMode and it would just use SDKā€¦ :upside_down_face:

Yes. Note that you donā€™t need the SDK, if you have SubMode, unless, you wanna specify a concrete version. You can also drop GenerateBitcode, as thatā€™s no longer supported by Apple or EBuild.

1 Like