Petey
August 17, 2024, 2:30am
1
Godot Version
4.3
Question
Hi All!
I’m having trouble exporting this project to iOS and getting this error -
NETSDK1207: Ahead-of-time compilation is not supported for the target framework. /usr/local/share/dotnet/sdk/8.0.401/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5)
If I rebuild a new project with the same contents it seems to work but I’d like to figure it out.
Does anyone know what might be causing that?
Thanks,
Pete
Petey
August 17, 2024, 11:14am
3
Yeah I saw that, but I couldn’t see a solution. It is closed though
It’s a bit strange that my new project with all the files copied across works fine. Is that a normal thing to do to “clean” a Godot project if it gets weird?
Moreus
August 17, 2024, 1:07pm
4
they mention compilation worked out which is here:
opened 11:58AM - 13 Sep 23 UTC
closed 11:57AM - 16 Sep 23 UTC
os-ios
area-NativeAOT-coreclr
### Description
Up until .NET RC1, NativeAOT compilation worked out of the box … when targeting `ios-arm64`.
This requires adding `<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>` and `<LinkerArg Include="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" />` to the csproj.
Everything else is pretty much standard fare.
Now, since RC1, `dotnet publish` fails because of linking errors in `libicuuc.a` related to C++.
As a workaround, one can add `<LinkerArg Include="-lc++" />` to the csproj like in the example below.
### Reproduction Steps
Running `dotnet publish` against the following example csproj works fine because `-lc++` was re-added using a `LinkerArg` flag. Removing this line makes the build fail.
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
<PublishAOT>true</PublishAOT>
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
</PropertyGroup>
<ItemGroup>
<LinkerArg Include="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" />
<LinkerArg Include="-lc++" />
</ItemGroup>
</Project>
```
### Expected behavior
Compiles out of the box.
### Actual behavior
Does not compile without adding `<LinkerArg Include="-lc++" />`.
### Regression?
It did work in all .NET 8 previews until RC1.
### Known Workarounds
Adding `<LinkerArg Include="-lc++" />` to the csproj.
### Configuration
.NET 8.0.100-rc.1.23455.8
### Other information
_No response_
not sure but maybe we gonna wait for fix that in next .Net update?
1 Like
Petey
August 17, 2024, 10:24pm
5
Oh cool, thanks! I’ll keep an eye out.