Git Product home page Git Product logo

Comments (9)

jonathanpeppers avatar jonathanpeppers commented on July 4, 2024

@vkacherov just to check, you are using the latest on the main branch?

We had someone else hit an error like this, and SourceTree didn't clone the Github "default" branch.

from maui-samples.

jonathanpeppers avatar jonathanpeppers commented on July 4, 2024

@rolfbjarne I think @mdh1418 is having the same problem, so there might be an issue with -t:Run for iOS?

from maui-samples.

mdh1418 avatar mdh1418 commented on July 4, 2024

I tried running the sample using sdk 5.0.100-rc.1.20466.16, 5.0.100-rc.1.20452.5, 5.0.100-rc.2.20459.1 (as expected by the repository) and still ran into that error with dotnet build HelloiOS/HelloiOS.csproj -t:Run. (Also had tried it with 6.0.100-alpha.1.20479.7`

I believe dotnet build itself succeeded for 5.0.1xx, but failed on 6.0.100-alpha.1.20479.7 with

/usr/local/share/dotnet/sdk/6.0.100-alpha.1.20479.7/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(213,5): error NETSDK1140: 13.6 is not a valid TargetPlatformVersion for iOS. Valid versions include: [/Users/mdhwang/net6-samples/HelloiOS/HelloiOS.csproj]
/usr/local/share/dotnet/sdk/6.0.100-alpha.1.20479.7/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(213,5): error NETSDK1140: None [/Users/mdhwang/net6-samples/HelloiOS/HelloiOS.csproj]

from maui-samples.

jonathanpeppers avatar jonathanpeppers commented on July 4, 2024

The known good version of .NET for this repo is here:

https://github.com/xamarin/net6-samples/blob/c0aff44b08420f8250296f7ec1318ac2bf1081b8/azure-pipelines.yml#L10

Depending on the build, an MSBuild property was renamed recently, which can cause the NETSDK1140 error:

dotnet/sdk@37d5ade

from maui-samples.

rolfbjarne avatar rolfbjarne commented on July 4, 2024

Using the known good version works for me:

$ git clean -xfd
$ git diff global.json
diff --git a/global.json b/global.json
index 0f80674..b5ac7f9 100644
--- a/global.json
+++ b/global.json
@@ -1,4 +1,5 @@
 {
+    "sdk": { "version": "5.0.100-rc.2.20459.1" },
     "msbuild-sdks": {
             "Microsoft.iOS.Sdk": "13.6.100-ci.main.379",
             "Microsoft.Android.Sdk": "11.0.100-ci.master.127"
$ dotnet build HelloiOS/HelloiOS.csproj
Microsoft (R) Build Engine version 16.8.0-preview-20454-01+b33e5486f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /Users/rolf/work/net6-samples/HelloiOS/HelloiOS.csproj (in 1.77 sec).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  HelloiOS -> /Users/rolf/work/net6-samples/HelloiOS/bin/Debug/net5.0-ios/ios-x64/HelloiOS.dll
  Detected signing identity:
          
    Bundle Id: com.microsoft.net5.helloios
    App Id: com.microsoft.net5.helloios
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:19.94

other versions don't work (with the error reported here).

from maui-samples.

rolfbjarne avatar rolfbjarne commented on July 4, 2024

@jonathanpeppers maybe we should bump to 5.0.100-rc.2.20480.7 here (and use updated packages, our main packages (version14.0.100-ci.main.558 for instance) support the new msbuild variable name)

from maui-samples.

jonathanpeppers avatar jonathanpeppers commented on July 4, 2024

I'll work on a PR that will give specific download URLs in the instructions and update our packages.

I think the original problem is the Run target may not be working:

$ dotnet build HelloiOS/HelloiOS.csproj -t:Run
...
/usr/local/share/dotnet/sdk/6.0.100-alpha.1.20479.7/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(814,5): error MSB3073: The command "dotnet exec "/Users/vadim/projects/net6-samples/HelloiOS/bin/Debug/net5.0-ios/ios-x64/HelloiOS.dll"" exited with code 129. [/Users/vadim/projects/net6-samples/HelloiOS/HelloiOS.csproj]

But I'll test this and see if it works for me.

from maui-samples.

jonathanpeppers avatar jonathanpeppers commented on July 4, 2024

@rolfbjarne even using Microsoft.iOS.Sdk 14.0.100-ci.main.559, I'm hitting the issue using -t:Run for the iOS app:

/usr/local/share/dotnet/sdk/5.0.100-rc.2.20480.7/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(814,5): error MSB3073: The command "dotnet exec "/Users/jopepper/src/net5-samples/HelloiOS/bin/Debug/net5.0-ios/ios-x64/HelloiOS.dll"" exited with code 131. [/Users/jopepper/src/net5-samples/HelloiOS/HelloiOS.csproj]

It's like it is using the built-in Run target, and maybe the iOS SDK needs to replace it? Android is using it's own Run target now:

https://github.com/xamarin/xamarin-android/blob/d1df638ec1d1f22cd37718814ac635eec5b3f472/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets#L26

from maui-samples.

rolfbjarne avatar rolfbjarne commented on July 4, 2024

Yes, I can reproduce that, I'll have a look.

from maui-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.