应用程序在 Google Play 商店崩溃一次,但从未在 Android Studio 中崩溃

App crashing once in the Google Play Store, but never on Android Studio

早上好。

我的应用程序在 Google Play 商店发布并从中安装后就崩溃了。如果我从 Android Studio 安装我的应用程序,它根本不会崩溃。

当我尝试打开一个从使用 RushORM 制作的本地数据库获取信息的布局时,应用程序似乎崩溃了。

这是 GP 控制台上的 ANR 报告:

ANR Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 35. Wait queue head age: 5507.1ms.)

这是 GP 控制台上的崩溃报告:

a.a.a.b.b.c: This is most likely caused by a change in data structure or new RushObject.
This issue should be resolved by a database migration.
This can be done by updating db version number in the manifest or setting Rush in debug mode.
To set Rush in debug mode add this to your manifest file - <meta-data android:name="Rush_debug" android:value="true" />
    at a.a.a.a.j.b(Unknown Source)
    at a.a.a.b.n.a(Unknown Source)
    at a.a.a.b.n.a(Unknown Source)
    at a.a.a.b.al.b(Unknown Source)
    at com.avena.avenafit.dashboard.g.L(Unknown Source)
    at com.avena.avenafit.dashboard.g.a(Unknown Source)
    at com.avena.avenafit.dashboard.ad.a(Unknown Source)
    at b.a.a.a.c.a(Unknown Source)
    at com.avena.avenafit.dashboard.ad.a(Unknown Source)
    at android.support.v4.app.af.a(Unknown Source)
    at android.support.v4.app.af.a(Unknown Source)
    at android.support.v4.app.j.run(Unknown Source)
    at android.support.v4.app.af.e(Unknown Source)
    at android.support.v4.app.af.b(Unknown Source)
    at android.support.v4.app.ap.b(Unknown Source)
    at android.support.v4.view.ViewPager.a(Unknown Source)
    at android.support.v4.view.ViewPager.c(Unknown Source)
    at android.support.v4.view.ViewPager.onMeasure(Unknown Source)
    at android.view.View.measure(View.java:18794)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    at android.support.design.widget.CoordinatorLayout.a(Unknown Source)
    at android.support.design.widget.CoordinatorLayout.onMeasure(Unknown Source)
    at android.view.View.measure(View.java:18794)
    at android.support.v4.widget.DrawerLayout.onMeasure(Unknown Source)
    at android.view.View.measure(View.java:18794)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.support.v7.widget.ContentFrameLayout.onMeasure(Unknown Source)
    at android.view.View.measure(View.java:18794)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    at android.view.View.measure(View.java:18794)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:18794)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    at android.view.View.measure(View.java:18794)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643)
    at android.view.View.measure(View.java:18794)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
    at android.view.Choreographer.doCallbacks(Choreographer.java:670)
    at android.view.Choreographer.doFrame(Choreographer.java:606)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

我已经尝试在我的清单文件中像这样更改我的数据库版本:

<!-- Updating this will cause a database upgrade -->
<meta-data
    android:name="Rush_db_version"
    android:value="2" />

现在,如果我从 GPSstore 安装了应用程序,并且打开了 Android Studio,我会看到很多奇怪的错误。在所有这些中,这个引起了我的注意:

07-11 11:17:08.037 17067-17067/com.avena.avenafit E/SQLiteLog: (1) no such column: type_of_check

type_of_check 如果我的一个数据库结构上的一个字段(正如我提到的,用 RushORM 制作)。作为参考,这是我的 class:

package com.avena.avenafit.dbb;

import co.uk.rushorm.core.RushObject;

public class UserCheck extends RushObject {

private String type_of_check;
private String check_date;
private String hour_checked;

/* Classes must include an empty constructor */
public UserCheck() {}

    public String getType_of_check() {
      return type_of_check;
    }
    public void setType_of_check(String type_of_check) {
      this.type_of_check = type_of_check;
    }

    public String getCheck_date() {
      return check_date;
    }
    public void setCheck_date(String check_date) {
      this.check_date = check_date;
    }

    public String getHour_checked() {
      return hour_checked;
    }
    public void setHour_checked(String hour_checked) {
      this.hour_checked = hour_checked;
    }

}

这是我设置 type_of_check:

的示例
breakfast.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            try {

                String time =
                        new SimpleDateFormat("HH:mm", Locale.getDefault()).format(date);

                sendCheck("check_breakfast");
                breakfast.setColorFilter(color_green);

                UserCheck check1 = new UserCheck();
                check1.setType_of_check("1");
                check1.setCheck_date(currentDate);
                check1.setHour_checked(time.toString());
                check1.save();

            } catch (JSONException e) {
                e.printStackTrace();
            }

        }
    });

有人看到我在这里遗漏了什么吗?

RushOrm 只需要这一行即可与 ProGuard 一起使用。

 -keep public class * implements co.uk.rushorm.core.Rush { *; }

它实现 Rush 的原因是因为您扩展的 RushObject 实现了 Rush 本身。

类 可以通过直接实现 Rush 而不是扩展 RushObject 来与 RushOrm 一起工作,这就是为什么这是将它与 ProGuard 一起使用的最佳方式

谢谢