Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot build or run .Net 8 tvOS project #2947

Open
1 task done
munit79 opened this issue Jul 18, 2024 · 2 comments
Open
1 task done

[BUG] Cannot build or run .Net 8 tvOS project #2947

munit79 opened this issue Jul 18, 2024 · 2 comments
Labels

Comments

@munit79
Copy link

munit79 commented Jul 18, 2024

Description

Create a new tvOS application in .Net 8, it builds and works fine. If I add a SkiaSharp reference, i.e.

<PackageReference Include="SkiaSharp" Version="2.88.8" />

Then the build fails with this error...

  ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang++ exited with code 1: [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64 [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mt/Desktop/test/test.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1836,3): warning : The file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/.DS_Store' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang++ exited with code 1: [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64 [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mt/Desktop/test/test.csproj]

Code

https://github.com/munit79/tvosfail

Expected Behavior

I'd expect the app to build and run.

Actual Behavior

It seems to want to link the wrong version of SkiaSharp, i.e. the device build rather than a simulator build.

I get a similar problem when compiling for the App Store, it builds OK, but Apple rejects the build because the skiasharp library is built for the simulator, not the device.

We were able to use SkiaSharp successfully on our Xamarin version of the tvOS app, and we can also successfully use it on the MAUI based iOS version of the app.

Version of SkiaSharp

2.88.3 (Current)

Last Known Good Version of SkiaSharp

Other (Please indicate in the description)

IDE / Editor

Visual Studio Code (macOS)

Platform / Operating System

macOS

Platform / Operating System Version

Building on MacBook Pro M3 Max

Devices

No response

Relevant Screenshots

No response

Relevant Log Output

mt@MacBook-Pro-M3 test % dotnet build -t:Run -f net8.0-tvos
  Determining projects to restore...
  All projects are up-to-date for restore.
  Detected signing identity:
          
    Bundle Id: com.companyname.test
    App Id: com.companyname.test
  test -> /Users/mt/Desktop/test/bin/Debug/net8.0-tvos/tvossimulator-arm64/test.dll
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1836,3): warning : The file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/.DS_Store' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [/Users/mt/Desktop/test/test.csproj]
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Tool xcrun execution finished (exit code = 1).
          
  ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang++ exited with code 1: [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64 [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mt/Desktop/test/test.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1836,3): warning : The file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/.DS_Store' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang++ exited with code 1: [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.8/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64 [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mt/Desktop/test/test.csproj]
    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.77
mt@MacBook-Pro-M3 test % dotnet build -t:Run -f net8.0-tvos
  Determining projects to restore...
/Users/mt/Desktop/test/test.csproj : warning NU1903: Package 'SkiaSharp' 2.88.3 has a known high severity vulnerability, https://github.com/advisories/GHSA-j7hp-h8jx-5ppr [/Users/mt/Desktop/test/test.sln]
  All projects are up-to-date for restore.
  Detected signing identity:
          
    Bundle Id: com.companyname.test
    App Id: com.companyname.test
/Users/mt/Desktop/test/test.csproj : warning NU1903: Package 'SkiaSharp' 2.88.3 has a known high severity vulnerability, https://github.com/advisories/GHSA-j7hp-h8jx-5ppr
  test -> /Users/mt/Desktop/test/bin/Debug/net8.0-tvos/tvossimulator-arm64/test.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size. This process might take a while.
  Tool xcrun execution finished (exit code = 1).
          
  ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.3/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang++ exited with code 1: [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.3/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64 [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mt/Desktop/test/test.csproj]

Build FAILED.

/Users/mt/Desktop/test/test.csproj : warning NU1903: Package 'SkiaSharp' 2.88.3 has a known high severity vulnerability, https://github.com/advisories/GHSA-j7hp-h8jx-5ppr
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang++ exited with code 1: [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : ld: building for tvOS Simulator, but linking in dylib built for tvOS, file '/Users/mt/.nuget/packages/skiasharp.nativeassets.tvos/2.88.3/runtimes/tvos/native/libSkiaSharp.framework/libSkiaSharp' for architecture arm64 [/Users/mt/Desktop/test/test.csproj]
/usr/local/share/dotnet/packs/Microsoft.tvOS.Sdk/17.2.8078/targets/Xamarin.Shared.Sdk.targets(1564,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mt/Desktop/test/test.csproj]
    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:22.45
mt@MacBook-Pro-M3 test %

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mattleibow
Copy link
Contributor

I suspect it will need something like this: #2468

@munit79
Copy link
Author

munit79 commented Aug 7, 2024

@mattleibow Is there a timeframe for this fix? Since Xamarin won't support the later Apple SDKs, we're forced to move to .Net 8, and Skia is a major part of our app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready For Work
Development

No branches or pull requests

2 participants