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

时间:2016-07-11 16:37:50

标签: android google-play google-console-developer rushorm

早上好。

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

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

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

  

ANR输入调度超时(等待发送非键事件,因为触摸的窗口尚未完成处理500.0ms前传递给它的某些输入事件。等待队列长度:35。等待队列头龄:5507.1ms 。)

这就是Crashes在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" />

现在,如果我从GPStore安装了应用程序,并且我打开了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制作)。作为参考,这是我的课程:

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();
            }

        }
    });

有人看到我在这里失踪了吗?

1 个答案:

答案 0 :(得分:2)

RushOrm只需要这一行就可以使用ProGuard。

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

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

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

由于