grpc-java appears to interpret "targetUri"s using the original RFC 2396 URI syntax from 1998. Unfortunately this means that it fails to parse the output of toUri(URI_INTENT_SCHEME) for many Android Intents, in particular, any Intent without a data URI. These are very common and encode all the non-URI fields in a fragment, like:
intent:#Intent;package=p;action=a;category=c;end;
ManagedChannelImplBuilder fails to pass a target string like this to the NameResolverProvider registered for "intent:" because java.net.URI() throws java.net.URISyntaxException: "Expected scheme-specific part at index 7"
In 2005, RFC 3986 revised the URI syntax to allow an empty scheme-specific part (among other relaxations). It would be nice if grpc-java could tolerate these too.