From 71f5b7d9b6043b57f7e803f38a7a2c3d971b7acb Mon Sep 17 00:00:00 2001 From: moezbhatti Date: Mon, 9 Sep 2019 21:58:32 -0400 Subject: [PATCH] Fix issues with release builds --- build.gradle | 2 +- common/src/main/AndroidManifest.xml | 2 +- .../com/moez/QKSMS/manager/ChangelogManagerImpl.kt | 3 +-- gradle.properties | 1 - presentation/proguard-rules.pro | 14 +++++++++++++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 3369e1b43..a85eb207f 100644 --- a/build.gradle +++ b/build.gradle @@ -21,6 +21,7 @@ buildscript { ext.material_version = '1.0.0' ext.mockito_version = '2.18.3' ext.moshi_version = '1.6.0' + ext.okhttp3_version = '4.1.0' ext.realm_version = '5.8.0' ext.realm_adapters_version = '3.1.0' ext.rxandroid_version = '2.0.1' @@ -30,7 +31,6 @@ buildscript { ext.rxkotlin_version = '2.1.0' ext.rx_preferences_version = '2.0.0-RC3' ext.timber_version = '4.5.1' - ext.okhttp3_version = '4.1.0' ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2] diff --git a/common/src/main/AndroidManifest.xml b/common/src/main/AndroidManifest.xml index b9d4a22b9..969a751c5 100644 --- a/common/src/main/AndroidManifest.xml +++ b/common/src/main/AndroidManifest.xml @@ -16,4 +16,4 @@ ~ You should have received a copy of the GNU General Public License ~ along with QKSMS. If not, see . --> - + diff --git a/data/src/main/java/com/moez/QKSMS/manager/ChangelogManagerImpl.kt b/data/src/main/java/com/moez/QKSMS/manager/ChangelogManagerImpl.kt index 14642017a..e5cc336dc 100644 --- a/data/src/main/java/com/moez/QKSMS/manager/ChangelogManagerImpl.kt +++ b/data/src/main/java/com/moez/QKSMS/manager/ChangelogManagerImpl.kt @@ -56,8 +56,7 @@ class ChangelogManagerImpl @Inject constructor( override fun getChangelog(): Single { val url = "https://firestore.googleapis.com/v1/projects/qksms-app/databases/(default)/documents/changelog" - val httpUrl = url.toHttpUrlOrNull() - val request = httpUrl?.let { Request.Builder().url(it).build() } + val request = url.toHttpUrlOrNull()?.let { Request.Builder().url(it).build() } val call = request?.let { OkHttpClient().newCall(it) } val adapter = moshi.adapter(ChangelogResponse::class.java) diff --git a/gradle.properties b/gradle.properties index ff2a5cd5c..bb91abfe1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,6 @@ org.gradle.jvmargs=-Xmx1536m org.gradle.caching=true android.useAndroidX=true android.enableJetifier=true -android.enableR8=false # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/presentation/proguard-rules.pro b/presentation/proguard-rules.pro index 10ac2a929..c984dc0aa 100644 --- a/presentation/proguard-rules.pro +++ b/presentation/proguard-rules.pro @@ -15,4 +15,16 @@ -dontwarn org.python.core.** # okio --dontwarn okio.** \ No newline at end of file +-dontwarn okio.** + +# JSR 305 annotations are for embedding nullability information. +-dontwarn javax.annotation.** + +# A resource is loaded with a relative path so the package of this class must be preserved. +-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase + +# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java. +-dontwarn org.codehaus.mojo.animal_sniffer.* + +# OkHttp platform used only on JVM and when Conscrypt dependency is available. +-dontwarn okhttp3.internal.platform.ConscryptPlatform