1
votes

I´m implementing a SQLite database on my app.

I have a SQLite_Android class that handles the DB connection. When I insert the dependency ([assembly: Dependency(typeof(SQLite_Android))]) I get a lot of errors like:

Error retrieving parent for item: No resource found that matches the given name 'Animation.AppCompat.Dialog'

Error retrieving parent for item: No resource found that matches the given name 'TextAppearence.AppCompat.Button'

No resource found that matches the given name: attr 'backgroundTint'.

No resource found that matches the given name: attr 'elevation'.

And finally:

Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.FileNotFoundException: Could not load assembly 'MyProject.App.Engine.Droid, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?

When I take that dependency line out of the class, the app builds successfully.

What I´ve already tried:

  • Updating the compiling SDK version
  • Updating all nuget packages
  • reinstalled Xamarin.Forms

So, someone please give me any ideas of what I should do to fix this

OBS, here is my Interface and my DBhelper:

[assembly: Dependency(typeof(SQLite_Android))]

namespace MyProject.Device.Engine.Droid.DB
    {
    public class SQLite_Android : ISQLConfig
    {
        public SQLite_Android(){}
    
        public SQLite.Net.SQLiteConnection GetConnection()
        {
            var fileName = "DbFile.db3";
            var documentsPath =     Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            var path = Path.Combine(documentsPath, fileName);

            var platform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
            var connection = new SQLite.Net.SQLiteConnection(platform, path);

            return connection;
        }
}

namespace MyProject.Device.Engine.Shared.Portable.DB
{
    public interface ISQLConfig
    {
        SQLiteConnection GetConnection();
    }
}
1

1 Answers

0
votes

You should specify full path to your class [assembly: Dependency(typeof(AppName.Path.SQLite_Android))]

For Example: [assembly: Dependency(typeof(AppName.Droid.DataBaseHelper.SQLite_Android))]