Git Product home page Git Product logo

Comments (3)

jonathanpeppers avatar jonathanpeppers commented on July 24, 2024 1

Hi @rachelkang, I think you need to change the $(RuntimeIdentifier) to ios-arm64 to run on a device. You could either change the .csproj file or use the -r switch at the command-line:

$ dotnet build HelloMaui -t:Run -f net6.0-ios -r ios-arm64

Let me know if that works, thanks.

The crash you get at startup, seems like a problem in Maui, to me:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
   at Microsoft.Maui.ViewExtensions.UpdateSemantics(UIView nativeView, IView view)
   at Microsoft.Maui.Handlers.ViewHandler.MapSemantics(IViewHandler handler, IView view)
   at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass21_0[[Microsoft.Maui.IView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.IViewHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IViewHandler r, IFrameworkElement v)
   at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IViewHandler viewHandler, IFrameworkElement virtualView)
   at Microsoft.Maui.PropertyMapper.UpdateProperties(IViewHandler viewHandler, IFrameworkElement virtualView)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.LayoutView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.LayoutHandler.SetVirtualView(IView view)
   at Microsoft.Maui.HandlerExtensions.ToNative(IView view, IMauiContext context)
   at Microsoft.Maui.MauiUIApplicationDelegate`1[[HelloMaui.Startup, HelloMaui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
--- End of stack trace from previous location ---
   at UIKit.UIApplication.Main(String[] args, IntPtr principal, IntPtr delegate)
   at UIKit.UIApplication.Main(String[] args, String principalClassName, String delegateClassName)
   at HelloMaui.Program.Main(String[] args) in /Users/rachelkang/net6-mobile-samples/HelloMaui/iOS/Program.cs:line 12
2021-04-09 09:34:47.389328-0400 HelloMaui[25843:192553] Unhandled managed exception: Object reference not set to an instance of an object (System.NullReferenceException)
   at Microsoft.Maui.ViewExtensions.UpdateSemantics(UIView nativeView, IView view)
   at Microsoft.Maui.Handlers.ViewHandler.MapSemantics(IViewHandler handler, IView view)
   at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass21_0[[Microsoft.Maui.IView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.IViewHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IViewHandler r, IFrameworkElement v)
   at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IViewHandler viewHandler, IFrameworkElement virtualView)
   at Microsoft.Maui.PropertyMapper.UpdateProperties(IViewHandler viewHandler, IFrameworkElement virtualView)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.LayoutView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.LayoutHandler.SetVirtualView(IView view)
   at Microsoft.Maui.HandlerExtensions.ToNative(IView view, IMauiContext context)
   at Microsoft.Maui.MauiUIApplicationDelegate`1[[HelloMaui.Startup, HelloMaui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
--- End of stack trace from previous location ---
   at UIKit.UIApplication.Main(String[] args, IntPtr principal, IntPtr delegate)
   at UIKit.UIApplication.Main(String[] args, String principalClassName, String delegateClassName)
   at HelloMaui.Program.Main(String[] args) in /Users/rachelkang/net6-mobile-samples/HelloMaui/iOS/Program.cs:line 12

from maui-samples.

rachelkang avatar rachelkang commented on July 24, 2024

@jonathanpeppers thanks for the suggestion! I tried both ways, and am now seeing this build error:

Build FAILED.

3   +[DVTExtendedPlatformInfo extendedPlatformInfoForPlatformIdentifier : error : ] (in DVTFoundation) [/Users/rachelkang/net6-mobile-samples/HelloMaui/HelloMaui.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.3.21202.5/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(876,5): error MSB3073: The command "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/14.4.100-preview.3.1326/tools/bin/mlaunch --launchdev bin/Debug/net6.0-ios/ios-arm64/HelloMaui.app/ --stdout /dev/ttys000 --stderr /dev/ttys000 --wait-for-exit" exited with code 134. [/Users/rachelkang/net6-mobile-samples/HelloMaui/HelloMaui.csproj]
    0 Warning(s)
    2 Error(s)

here's the full gist: https://gist.github.com/rachelkang/9aad005729e49e600e1ebffc60abea2a

and thanks for nothing the MAUI issue - I think we've since fixed that exception, but will definitely continue to keep an eye out for it

from maui-samples.

jonathanpeppers avatar jonathanpeppers commented on July 24, 2024

Do you have an Xcode 12.4? I don't think 12.5 works yet.

I normally install them side-by-side and use sudo xcode-select -s /Applications/Xcode12.4.app/ to switch between versions.

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.