herrmartell
herrmartell

Reputation: 3117

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

Good morning.

My app is crashing once it is published on the Google Play Store, and then installed from it. If I install my app from Android Studio, it won't crash at all.

The app seems to be crashing when I try to open a layout that grabs information from a local db made with RushORM.

This is what the ANRs reports on the GP Console:

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.)

And this is what the Crashes reports on the GP Console:

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)

I already tried changing my DB version like this on my Manifest file:

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

Now, if I have the app installed from the GPStore, and I have Android Studio open, I see lots of weird errors registered. Of all of those, this one gets my attention:

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

type_of_check if a field on one of my db structures (as I mentioned, made with RushORM). For reference, here's my 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;
    }

}

And here's an example where I set the 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();
            }

        }
    });

Does anyone see what I'm missing here?

Upvotes: 0

Views: 678

Answers (1)

Stuart Campbell
Stuart Campbell

Reputation: 1147

RushOrm only requires this one line to work with ProGuard.

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

The reason why it's implements Rush is because RushObject which you extend implements Rush itself.

Classes can work with RushOrm by directly implementing Rush instead of extending RushObject which is why this is the best way to use it with ProGuard

Thanks

Upvotes: 2

Related Questions