From b6804290473d6383f0b5b887c913b328d83a6925 Mon Sep 17 00:00:00 2001 From: wbrunette Date: Mon, 16 Sep 2019 12:43:26 -0700 Subject: [PATCH 1/3] add multidexing support --- tables_app/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tables_app/build.gradle b/tables_app/build.gradle index 5db5e89b..94501fe0 100644 --- a/tables_app/build.gradle +++ b/tables_app/build.gradle @@ -29,6 +29,8 @@ android { testApplicationId(groupId + tablesName + testNameSuffix) testInstrumentationRunner(instrumentationRunner) + + multiDexEnabled true } flavorDimensions "stage", "testing" @@ -134,6 +136,8 @@ dependencies { transitive =true; } + implementation 'androidx.multidex:multidex:2.0.1' + if (libraryProjectPath.exists() && gradle.useLocal) { // Local project is favoured implementation project(libraryProjectName) } else { From da70cf921735f2164ba3ce99e5b84f524a0b9592 Mon Sep 17 00:00:00 2001 From: wbrunette Date: Mon, 16 Sep 2019 14:28:32 -0700 Subject: [PATCH 2/3] override attachbase --- .../org/opendatakit/tables/application/Tables.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tables_app/src/main/java/org/opendatakit/tables/application/Tables.java b/tables_app/src/main/java/org/opendatakit/tables/application/Tables.java index afb32077..11c74c8f 100644 --- a/tables_app/src/main/java/org/opendatakit/tables/application/Tables.java +++ b/tables_app/src/main/java/org/opendatakit/tables/application/Tables.java @@ -14,6 +14,10 @@ package org.opendatakit.tables.application; +import android.content.Context; + +import androidx.multidex.MultiDex; + import com.crashlytics.android.Crashlytics; import com.google.firebase.analytics.FirebaseAnalytics; import io.fabric.sdk.android.Fabric; @@ -44,6 +48,13 @@ public static Tables getInstance() { return ref.get(); } + @Override + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } + + @Override public int getApkDisplayNameResourceId() { return R.string.app_name; From b98385a66900a98f0207b8523bbe68d5a7582b35 Mon Sep 17 00:00:00 2001 From: wbrunette Date: Mon, 16 Sep 2019 15:51:15 -0700 Subject: [PATCH 3/3] attempt to fix context in preferences --- .../tables/preferences/DefaultViewTypePreference.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tables_app/src/main/java/org/opendatakit/tables/preferences/DefaultViewTypePreference.java b/tables_app/src/main/java/org/opendatakit/tables/preferences/DefaultViewTypePreference.java index 22c6bb5e..86145d11 100644 --- a/tables_app/src/main/java/org/opendatakit/tables/preferences/DefaultViewTypePreference.java +++ b/tables_app/src/main/java/org/opendatakit/tables/preferences/DefaultViewTypePreference.java @@ -58,9 +58,9 @@ public class DefaultViewTypePreference extends ListPreference { */ public DefaultViewTypePreference(Context context, AttributeSet attrs) { super(context, attrs); - mContext = ((ContextThemeWrapper) context).getBaseContext(); - if (mContext instanceof IAppAwareActivity) { - mAppName = ((IAppAwareActivity) mContext).getAppName(); + if (context instanceof IAppAwareActivity) { + mContext = context; + mAppName = ((IAppAwareActivity) context).getAppName(); } else { throw new IllegalArgumentException("Must be in an activity that knows the app name"); }