0

I have a problem with this Nuget Package: https://www.nuget.org/packages/sqlite-net-pcl/1.0.11

In my test Case I have a PCLLibrary called "PCL" with this NuGet Package. And an emtpy class which has

using SQLite;
namespace PCL
{
    public class Test
    {

    }
}

Now I create a new Xamarin.Forms PCL Project and reference this Library

using System;
using Xamarin.Forms;

namespace PCL
{
    public class App : Application
    {
        public App ()
        {
            // The root page of your application
            MainPage = new ContentPage {
                Content = new StackLayout {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                        new Label {
                            XAlign = TextAlignment.Center,
                            Text = "Welcome to Xamarin Forms!"
                        }
                    } 
                }
            };
            var test = new Test();
        }
    }
}

Now I run my App in iOS Simulator and it gets killed ... When i am not creating an instance of Test this App starts fine... When I integrate this Package directly in my Forms Library, I can use it normally. What can cause this?

SYNT4X
  • 210
  • 2
  • 15

1 Answers1

0

Normally when you are dealing with NuGet packages on PCL's you need to add the NuGet package on the iOS project as well as the PCL. This is because it may have some platform specific code in it (will definitely be the case with a SQLite library).

When you add it to the iOS project it loads the specific assemblies for iOS that is needed. Its just something you need to be aware of.

Also I would recommend this package: https://www.nuget.org/packages/SQLite.Net-PCL/

Adam
  • 16,089
  • 6
  • 66
  • 109
  • I have tried to add the package in all Projects without success. But I will try it with your recommended Package. Thanks. – SYNT4X Aug 03 '15 at 16:00
  • And another thing. Is there a way how I can see what ist wrong? I totally hate it, that I don´t get ANY feedback in Xamarin.Forms when something is not working. Its like debugging PHP with a Browser :-/ – SYNT4X Aug 03 '15 at 16:04
  • On iOS there are log files. Off the top of my head I can't remember where they keep getting generated. My setup is Visual Studio with Mac Build Host. But a quick search this might get you on track - http://stackoverflow.com/questions/10165641/how-can-i-get-the-console-logs-from-the-ios-simulator However the best way to debug with Xamarin forms in my opinion, is develop a Windows Phone app, do all your debugging in there. Then when you want to build for iOS and Android, you will likely only have a few issues to resolve. – Adam Aug 03 '15 at 17:31
  • ah, ok. Thanks for that information. I can try that. – SYNT4X Aug 04 '15 at 08:40