Xamarin: Visual Studio iOS app start always fails (crawl detected)

  • Xamarin Noob
  • Xamarin.Forms Noob

    I'm all connected. Business license for iOS and Android and development with VS 2013. I created an initial sample from Xamarin Intro for forms .

    I launched the application and it worked fine on my Mac. I saw "Hello, forms!" shortcut in a running app in iOS simulator on my Mac Build machine.

Then I replaced the following code in my App.cs

public static Page GetMainPage()
{
    return new ContentPage
    {
        Content = new Label
        {
            Text = "Hello, Forms !",
            VerticalOptions = LayoutOptions.CenterAndExpand,
            HorizontalOptions = LayoutOptions.CenterAndExpand,
        },
    };
}

      

from:

public static Page GetMainPage()
{
    return new ContentPage()
    {
        Content = new StackLayout
        {
            Spacing = 10,
            Children =
            {
                new Label
                {
                    Text = "Stop",
                    BackgroundColor = Color.Red,
                    Font = Font.SystemFontOfSize(20)
                },
                new Label
                {
                    Text = "Slow down",
                    BackgroundColor = Color.Yellow,
                    Font = Font.SystemFontOfSize(20)
                },
                new Label
                {
                    Text = "Go",
                    BackgroundColor = Color.Green,
                    Font = Font.SystemFontOfSize(20)
                }
            }
        }
    };
}

      

That's all I did, but now the app won't run in the simulator - it always exists as soon as it starts ...

I put my original code back again and it still won't start.

I always see (in My VS 12013 Mac Server Log)

[10-Nov-2014 15:43:32] Request handled in 4.129ms
[10-Nov-2014 15:43:37] Request handled in 3.728ms
[10-Nov-2014 15:43:40] stdout: Starting iPhone 5s
Launching application
Application launched. PID = 2872
Press enter to terminate the application
>
Application Terminated
[10-Nov-2014 15:43:42] Request handled in 3.898ms
[10-Nov-2014 15:43:48] Request handled in 4.031ms
etc....

      

I quit iOS and VS 2013 simulator, paired them again, all to no avail ...

What could be wrong?

EDIT Infact, when the app becomes visible in the icon simulator view, clicking on it brings up the original version of "Hello, Forms!" - so my new code is never deployed to the simulator ...

EDIT 2  Ok, I got a new content movement and ran it:

I had to manually "Reset content on device" in the iOS simulator on Mac. I also had to manually clean each project in VS 2013 - just rebuilding the solution does nothing for the content being sent to the Mac iOS simulator server I guess.

I hope this helps someone new like me.

+3


source to share


2 answers


Try deleting the "." on behalf of your application in the Info.plist file.



+2


source


After messing around ..

The way to fix this is to change the build configuration in the solution.

In the new Xamarin.Forms solution in Visual Studio, you can:



Solution 'MyXFormsSample' (3 projects)
 v MyXFormsSample (Portable)
   > Properties
   > References
   > App.cs
     packages.config
 > MyXFormsSample.Android
 > MyXFormsSample.iOS

      

It appears that by default, in the build configuration of the Configuration Manager solution, the portable code project is not configured to build for the iPhoneSimulator platform.

I clicked this button to debug and also released the solution config, and before that I had to Reset Content on the Mac iOS simulator before debugging, then I only had to click the green Start button in the menu - everything was updated and released on the iOS Simulator server Mac Build.

0


source







All Articles