SQLite-net-pcl - SQLite.SQLiteException:无法添加PRIMARY KEY列

时间:2017-01-21 12:42:29

标签: xamarin sqlite-net sqlite-net-extensions

我今天似乎遇到了各种各样的问题。签署APK时,我无法让Sqlite-net-pcl正常运行。调试和发布工作正常,但每次我创建APK的签名版本时该应用程序崩溃与此问题: -

SQLite.SQLiteException: Cannot add a PRIMARY KEY column

以下是我的模型示例: -

using SQLite.Net.Attributes;
using System;

namespace App.BusinessLayer.LocalObjects
{
[Preserve(AllMembers = true)]
public class LocalTip
{

public int ID { get; set; }

[PrimaryKey, Column("tipObjectId")]
public string objectId { get; set; }
public DateTime createdAt { get; set; }
public DateTime updatedAt { get; set; }
public string Title { get; set; }
public string Bet { get; set; }
public string Description { get; set; }
public string Rating { get; set; }
public string Time { get; set; }
public string Bookies { get; set; }
public string Url { get; set; }
public int Status { get; set; }
public Double Odds { get; set; }
public int Outcome { get; set; }

public LocalTip()
{
    this.objectId = " ";
    this.Title = " ";
    this.Bet = " ";
    this.Description = " ";
    this.Rating = " ";
    this.Time = " ";
    this.Bookies = " ";
    this.Url = " ";
}
}
}

有没有人见过这个?

0 个答案:

没有答案