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

Revert "Update objenesis to 3.1" #2009

Closed
wants to merge 1 commit into from

Conversation

TimvdLippe
Copy link
Contributor

Reverts #1998

See #2007 for more info on how this breaks Android

Fixes #2007

@TimvdLippe TimvdLippe requested a review from raphw August 19, 2020 14:50
@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2020

Codecov Report

Merging #2009 into release/3.x will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##             release/3.x    #2009   +/-   ##
==============================================
  Coverage          84.90%   84.90%           
  Complexity          2692     2692           
==============================================
  Files                324      324           
  Lines               8161     8161           
  Branches             972      972           
==============================================
  Hits                6929     6929           
  Misses               964      964           
  Partials             268      268           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31bdc24...5fa2a74. Read the comment docs.

@raphw
Copy link
Member

raphw commented Aug 19, 2020

Annoying but probably the best option. Maybe we can explicitly downgrade Objenesis in the mockito-android artifact instead?

Copy link
Member

@raphw raphw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we can just downgrade the version in mockito-android? What errors did the new Objenesis fix? Maybe it's required to work with the newest Java versions?

Copy link
Member

@raphw raphw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we can just downgrade the version in mockito-android? What errors did the new Objenesis fix? Maybe it's required to work with the newest Java versions?

@TimvdLippe
Copy link
Contributor Author

Hm yes that could work. I can test that out tomorrow.

@kozaxinan
Copy link
Contributor

This issue still blocks android projects to use latest mockito. Is further work planned on this PR? If not I can provide a different PR with requested fix.

@TimvdLippe
Copy link
Contributor Author

I have not yet had the time to do an analysis on this issue. If you have a proposed fix and you can confirm it works, I would be very happy to review it! Thanks in advance 😄

@raphw
Copy link
Member

raphw commented Aug 26, 2020

Just to be sure: did you try to downgrade Objenesis explicitly? Are you using mockito-android?

@kozaxinan
Copy link
Contributor

We downgraded objenesis version with gradle dependency resolutions.

configurations.configureEach {
    resolutionStrategy.eachDependency { details ->
     if (details.requested.group == 'org.objenesis') {
        details.useVersion '2.6'
      } 
    }
  }

This worked well. We have mockito-android too, but in most case we also have mockito-core with com.nhaarman.mockitokotlin2:mockito-kotlin

I will build a mockito-android with older objenesis and check the fix. (It might take time)

@raphw
Copy link
Member

raphw commented Aug 26, 2020

Thank you.

My favorit solution would be to fix the version for Android-specific artifacts but use the latest for core to support newer Java versions.

@kozaxinan
Copy link
Contributor

kozaxinan commented Aug 26, 2020

I have experimented downgrading objenesis just in mockito-android. When mockito-android is used with mockito-kotln, gradle uses higher version from mockito-kotlin. A solution is suggested in #2024.

@TimvdLippe
Copy link
Contributor Author

This was fixed in #2024

@TimvdLippe TimvdLippe closed this Sep 3, 2020
@TimvdLippe TimvdLippe deleted the revert-1998-objenesis_3_1 branch September 3, 2020 22:34
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 this pull request may close these issues.

Android instrumentation test packaging fails for mockito-android 3.5.0 with minSdk < 26
4 participants