我有一个简单的实体,叫做 Dog (狗),它位于包“ com.plat.model”
中public class Dog extends SugarRecord<Dog> implements Parcelable {
String name;
public Dog() {}
public Dog(Parcel in) {
this.id = in.readLong();
this.name = in.readString();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
if (this.id != null) {
dest.writeLong(this.id);
} else {
dest.writeLong(-1);
}
dest.writeString(this.name);
}
public static final Creator CREATOR = new Creator() {
public Dog createFromParcel(Parcel in) {
return new Dog(in);
}
public Dog[] newArray(int size) {
return new Dog[size];
}
};
@Override
public int describeContents() {
return 0;
}
}
<application
android:name="com.plat.app.MyApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="DATABASE"
android:value="platinum_dogs.db" />
<meta-data
android:name="VERSION"
android:value="11" />
<meta-data
android:name="QUERY_LOG"
android:value="false" />
<meta-data
android:name="DOMAIN_PACKAGE_NAME"
android:value="com.plat.model" />
//...
public class MyApp extends SugarApp {
@Override
public void onCreate() {
super.onCreate();
}
}
当我启动该应用程序时,糖罐的负载就像永远一样。我有一个只有名称属性的表,并且它的生成时间超过30秒。与表创建和表升级相同。
2019-01-02 12:54:31.396 23094-23094/com.plat I/Sugar: upgrading sugar
2019-01-02 12:54:31.397 23094-23094/com.plat W/zygote64: Opening an oat file without a class loader. Are you using the deprecated DexFile APIs?
2019-01-02 12:54:32.158 23094-23099/com.plat I/zygote64: Do partial code cache collection, code=25KB, data=17KB
2019-01-02 12:54:32.159 23094-23099/com.plat I/zygote64: After code cache collection, code=25KB, data=17KB
2019-01-02 12:54:32.159 23094-23099/com.plat I/zygote64: Increasing code cache capacity to 128KB
2019-01-02 12:54:39.993 23094-23094/com.plat I/Sugar: domain class
2019-01-02 12:54:39.994 23094-23094/com.plat I/Sugar: domain class
2019-01-02 12:54:40.144 23094-23094/com.plat W/zygote64: Opening an oat file without a class loader. Are you using the deprecated DexFile APIs?
2019-01-02 12:54:53.807 23094-23094/com.plat I/Sugar: domain class
2019-01-02 12:54:53.808 23094-23094/com.plat I/Sugar: domain class
2019-01-02 12:54:54.152 23094-23094/com.plat I/Sugar: on create
2019-01-02 12:54:54.153 23094-23094/com.plat W/zygote64: Opening an oat file without a class loader. Are you using the deprecated DexFile APIs?
2019-01-02 12:55:07.031 23094-23094/com.plat I/Sugar: domain class
2019-01-02 12:55:07.032 23094-23094/com.plat I/Sugar: domain class
2019-01-02 12:55:07.288 23094-23094/com.plat I/Sugar: create table
2019-01-02 12:55:07.288 23094-23094/com.plat D/Sugar: Fetching properties
2019-01-02 12:55:07.296 23094-23094/com.plat I/Sugar: creating table DOG
这是什么'W / zygote64:在没有类加载器的情况下打开燕麦文件。您正在使用不推荐使用的DexFile API吗?警告?
我使用糖球已有多年了,但是我从未见过。
该应用程序的 targetSdkVersion 和 compileSdkVersion 为 28
可能是什么问题?
谢谢。