Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidChannelBuilderTest is incompatible with Robolectric 4.4 #7731

Closed
ejona86 opened this issue Dec 16, 2020 · 2 comments
Closed

AndroidChannelBuilderTest is incompatible with Robolectric 4.4 #7731

ejona86 opened this issue Dec 16, 2020 · 2 comments
Milestone

Comments

@ejona86
Copy link
Member

ejona86 commented Dec 16, 2020

When I tried to upgrade to robolectric 4.4, compilation failed:

grpc-java/android/src/test/java/io/grpc/android/AndroidChannelBuilderTest.java:116: error: cannot access RoleManager
    shadowOf(connectivityManager).setActiveNetworkInfo(WIFI_CONNECTED);
    ^
  class file for android.app.role.RoleManager not found
1 error

It's not obvious to me what is going on, but I'm not familiar with shadowOf()

@ejona86 ejona86 added this to the Next milestone Dec 16, 2020
ejona86 added a commit to ejona86/grpc-java that referenced this issue Dec 16, 2020
I didn't touch Protobuf and Netty; we upgrade those individually. Below
are issues I encountered that caused me to not upgrade (further).

Guava 30.1-android fails to build with Android without enabling
desugaring. google/guava#5358

Robolectric 4.4 breaks AndroidChannelBuilderTest.
grpc#7731

Opencensus 0.28.1+ is incompatible with gRPC.
census-instrumentation/opencensus-java#2069
grpc#7732

Truth now defines the asm dependency as "compile" although it is still
optional. But asm appears to have accidentally included incorrect gradle
module metadata in their release (I see they've disabled the metadata on
master) which make gradle think it requires Java 8. We could asm
everywhere, but that's is annoying. It seems likely this will resolve
itself.

Mockito can be upgraded to 3.4.0, but it deprecates initMocks, which
causes more code churn than I wanted in this commit. I still
synchronized the example versions on 3.4.0, though, as it was already
being used in some examples and the examples don't use initMocks.
ejona86 added a commit that referenced this issue Dec 17, 2020
I didn't touch Protobuf and Netty; we upgrade those individually. Below
are issues I encountered that caused me to not upgrade (further).

Guava 30.1-android fails to build with Android without enabling
desugaring. google/guava#5358

Robolectric 4.4 breaks AndroidChannelBuilderTest.
#7731

Opencensus 0.28.1+ is incompatible with gRPC.
census-instrumentation/opencensus-java#2069
#7732

Truth now defines the asm dependency as "compile" although it is still
optional. But asm appears to have accidentally included incorrect gradle
module metadata in their release (I see they've disabled the metadata on
master) which make gradle think it requires Java 8. We could asm
everywhere, but that's is annoying. It seems likely this will resolve
itself.

Mockito can be upgraded to 3.4.0, but it deprecates initMocks, which
causes more code churn than I wanted in this commit. I still
synchronized the example versions on 3.4.0, though, as it was already
being used in some examples and the examples don't use initMocks.
dfawley pushed a commit to dfawley/grpc-java that referenced this issue Jan 15, 2021
I didn't touch Protobuf and Netty; we upgrade those individually. Below
are issues I encountered that caused me to not upgrade (further).

Guava 30.1-android fails to build with Android without enabling
desugaring. google/guava#5358

Robolectric 4.4 breaks AndroidChannelBuilderTest.
grpc#7731

Opencensus 0.28.1+ is incompatible with gRPC.
census-instrumentation/opencensus-java#2069
grpc#7732

Truth now defines the asm dependency as "compile" although it is still
optional. But asm appears to have accidentally included incorrect gradle
module metadata in their release (I see they've disabled the metadata on
master) which make gradle think it requires Java 8. We could asm
everywhere, but that's is annoying. It seems likely this will resolve
itself.

Mockito can be upgraded to 3.4.0, but it deprecates initMocks, which
causes more code churn than I wanted in this commit. I still
synchronized the example versions on 3.4.0, though, as it was already
being used in some examples and the examples don't use initMocks.
@markb74
Copy link
Contributor

markb74 commented Mar 21, 2021

According to robolectric/robolectric#5636, this should have been resolved when the Android API was bumped to 29.

(And it appears to work for me).

@ejona86 ejona86 modified the milestones: Next, 1.37 Mar 24, 2021
@ejona86
Copy link
Member Author

ejona86 commented Mar 24, 2021

Fixed by #7796.

@ejona86 ejona86 closed this as completed Mar 24, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants