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

Shadows.shadowOf() raise compile error since Robolectric 4.8 #7286

Closed
ganadist opened this issue May 2, 2022 · 5 comments · Fixed by robolectric/robolectric-bazel#29
Closed

Comments

@ganadist
Copy link

@ganadist ganadist commented May 2, 2022

Description

Steps to Reproduce

  1. clone sample source
$ git clone https://github.com/ganadist/VersionCodeDemo -b robo48_compile_error
$ cd VersionCodeDemo 
$ ./gradlew :app:testDevelopDebugUnitTest
> Task :app:compileDevelopDebugUnitTestJavaWithJavac FAILED
app/src/test/java/com/example/myapplication/TelephonyTest.java:24: error: cannot access BackdropFrameRenderer
    ShadowTelephonyManager shadow = Shadows.shadowOf(tM);
                                             ^
 class file for com.android.internal.policy.BackdropFrameRenderer not found
 1 error

 FAILURE: Build failed with an exception.

Robolectric & Android Version

  • Robolectric 4.8
  • CompileSdk/TargetSdk 32

Link to a public git repo demonstrating the problem:

@utzcoz
Copy link
Member

@utzcoz utzcoz commented May 2, 2022

Fixed by #7284.

@utzcoz utzcoz closed this as completed May 2, 2022
@utzcoz
Copy link
Member

@utzcoz utzcoz commented May 4, 2022

Hi @ganadist , could you test 4.8.1 to check whether it fixes your problem? Thanks.

@ganadist
Copy link
Author

@ganadist ganadist commented May 4, 2022

@utzcoz ,
Sure, I already tested, and 4.8.1 fixed my problem.
Thank you very much!

@utzcoz
Copy link
Member

@utzcoz utzcoz commented May 4, 2022

@ganadist Thanks for testing.

@jhwsx
Copy link

@jhwsx jhwsx commented Jul 3, 2022

4.8.1 REALLY works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants