Skip to content

Commit

Permalink
android: Add ProGuard rules for NameResolverProvider
Browse files Browse the repository at this point in the history
Without the rules, all RPCs fail since no providers are found. We like
the idea of RPCs working.
  • Loading branch information
ejona86 committed Jun 21, 2016
1 parent b7ed883 commit 4372cee
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion android-interop-testing/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
-dontwarn sun.reflect.**
-dontwarn android.test.**

# Need to create channel through service provider.
# Providers use their name to load files from META-INF
-keepnames class io.grpc.ServerProvider
-keepnames class io.grpc.ManagedChannelProvider
-keepnames class io.grpc.NameResolverProvider

# The Provider implementations must be kept and retain their names, since the
# names are referenced from META-INF
-keep class io.grpc.internal.DnsNameResolverProvider
-keep class io.grpc.okhttp.OkHttpChannelProvider
12 changes: 11 additions & 1 deletion examples/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@
# Add any project specific keep options here:

-dontwarn com.google.common.**
-dontwarn okio.**
-dontwarn okio.**

# Providers use their name to load files from META-INF
-keepnames class io.grpc.ServerProvider
-keepnames class io.grpc.ManagedChannelProvider
-keepnames class io.grpc.NameResolverProvider

# The Provider implementations must be kept and retain their names, since the
# names are referenced from META-INF
-keep class io.grpc.internal.DnsNameResolverProvider
-keep class io.grpc.okhttp.OkHttpChannelProvider

0 comments on commit 4372cee

Please sign in to comment.