Fix: Address Android 11 crash.

Closes https://github.com/zcash/zcash-android-wallet-sdk/issues/198
Addresses the underlying issue behind https://github.com/horizontalsystems/unstoppable-wallet-android/issues/3013
by making the necessary changes to upgrade to the latest version of gRPC and grpc-okhttp.
This commit is contained in:
Kevin Gorham 2021-01-05 14:42:23 -05:00
parent a9e609224f
commit 9bf087bed8
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
1 changed files with 19 additions and 5 deletions

View File

@ -12,7 +12,7 @@ buildscript {
'room': '2.2.5',
'paging': '2.1.2'
],
'grpc':'1.25.0', // NOTE: cannot use a higher version because they use protobuf 3.10+ which is not compatible with 3.0+ so we'd have to implement changes in our protobuf files which breaks everything
'grpc':'1.34.1',
'coroutines': '1.3.9',
'junitJupiter': '5.6.1'
]
@ -33,7 +33,7 @@ buildscript {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.1"
classpath "com.github.ben-manes:gradle-versions-plugin:0.31.0"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.13"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.14"
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:1.0.2'
classpath 'com.github.str4d:rust-android-gradle:68b4ecc053'
classpath 'org.owasp:dependency-check-gradle:6.0.0'
@ -173,16 +173,20 @@ dokka {
protobuf {
generatedFilesBaseDir = "$projectDir/src/generated/source/grpc"
protoc { artifact = 'com.google.protobuf:protoc:3.7.1' }
protoc { artifact = 'com.google.protobuf:protoc:3.14.0' }
plugins {
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${versions.grpc}" }
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option "lite"
}
}
task.plugins {
javalite {}
grpc { // Options added to --grpc_out
grpc {
option 'lite'
}
}
@ -247,6 +251,16 @@ dependencies {
// per this recommendation from Chris Povirk, given guava's decision to split ListenableFuture away from Guava: https://groups.google.com/d/msg/guava-discuss/GghaKwusjcY/bCIAKfzOEwAJ
implementation 'com.google.guava:guava:27.0.1-android'
// Transitive dependencies used because they're already necessary for other libraries
// GSON is available as a transitive dependency from several places so we use it for processing
// checkpoints but also document that by explicitly including here. If dependencies like Room
// or grpc-okhttp stop including GSON, then we should switch to something else for parsing JSON.
implementation 'com.google.code.gson:gson:2.8.6'
// OKIO is a transitive dependency used when writing param files to disk. Like GSON, this can be
// replaced if needed. For compatibility, we match the library version used in grpc-okhttp:
// https://github.com/grpc/grpc-java/blob/v1.34.x/build.gradle#L154
implementation 'com.squareup.okio:okio:1.13.0'
// Tests
testImplementation 'androidx.multidex:multidex:2.0.1'
testImplementation "org.jetbrains.kotlin:kotlin-reflect:${Deps.kotlinVersion}"