mirror of https://github.com/grpc/grpc-java.git
android: Fix ProGuard rules in Android apps
Fixes #2207. This is actually a workaround. Ideally users shouldn't need to -keep classes, but it's a bit risky to fix the real issue before 1.1. The further fix will be done as part of #2633. The interop app's build.gradle change is necessary to compile with newer Gradle versions. The com.google.errorprone.annotations was necessary in order to prevent annotation warnings from failing the build.
This commit is contained in:
parent
a4e481b3f9
commit
06c40dccc3
|
|
@ -14,3 +14,7 @@
|
||||||
-dontwarn org.mockito.**
|
-dontwarn org.mockito.**
|
||||||
-dontwarn sun.reflect.**
|
-dontwarn sun.reflect.**
|
||||||
-dontwarn android.test.**
|
-dontwarn android.test.**
|
||||||
|
# Ignores: can't find referenced class javax.lang.model.element.Modifier
|
||||||
|
-dontwarn com.google.errorprone.annotations.**
|
||||||
|
-keep class io.grpc.internal.DnsNameResolverProvider
|
||||||
|
-keep class io.grpc.okhttp.OkHttpChannelProvider
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ buildscript {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.5.0'
|
classpath 'com.android.tools.build:gradle:2.2.0'
|
||||||
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"
|
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|
|
||||||
|
|
@ -12,3 +12,7 @@
|
||||||
-dontwarn sun.misc.Unsafe
|
-dontwarn sun.misc.Unsafe
|
||||||
-dontwarn com.google.common.**
|
-dontwarn com.google.common.**
|
||||||
-dontwarn okio.**
|
-dontwarn okio.**
|
||||||
|
# Ignores: can't find referenced class javax.lang.model.element.Modifier
|
||||||
|
-dontwarn com.google.errorprone.annotations.**
|
||||||
|
-keep class io.grpc.internal.DnsNameResolverProvider
|
||||||
|
-keep class io.grpc.okhttp.OkHttpChannelProvider
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Add project specific ProGuard rules here.
|
# Add project specific ProGuard rules here.
|
||||||
# By default, the flags in this file are appended to flags specified
|
# By default, the flags in this file are appended to flags specified
|
||||||
# in /usr/local/google/home/rocking/Android/Sdk/tools/proguard/proguard-android.txt
|
# in $ANDROID_HOME/tools/proguard/proguard-android.txt
|
||||||
# You can edit the include path and order by changing the proguardFiles
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
# directive in build.gradle.
|
# directive in build.gradle.
|
||||||
#
|
#
|
||||||
|
|
@ -12,4 +12,7 @@
|
||||||
-dontwarn sun.misc.Unsafe
|
-dontwarn sun.misc.Unsafe
|
||||||
-dontwarn com.google.common.**
|
-dontwarn com.google.common.**
|
||||||
-dontwarn okio.**
|
-dontwarn okio.**
|
||||||
|
# Ignores: can't find referenced class javax.lang.model.element.Modifier
|
||||||
|
-dontwarn com.google.errorprone.annotations.**
|
||||||
|
-keep class io.grpc.internal.DnsNameResolverProvider
|
||||||
|
-keep class io.grpc.okhttp.OkHttpChannelProvider
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue