Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why exactly are API levels < 26 not supported?#332

Answeredbymannodermaus
bddckr asked this question inQ&A
Discussion options

While the Readme explains

Because the framework is built on Java 8 from the ground up, these instrumentation tests will only run on devices running Android 8.0 (API 26) or newer – older phones will skip the execution of these tests completely, marking them as "ignored".

I'm wondering what exactly the "issue" is to support earlier API levels.

In a very crude early test, I could execute some tests on API level 25 (my min SDK) without issues. Perhaps it's because I've enabledAGP's desugaring support?

If it boils down tosome JUnit 5 functionality not being available, I'd like to request this check, perhaps via some explicit opt-in flag in the Gradle plugin this project provides? 👀

val runner=if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.O) {
AndroidJUnit5(klass)
}else {
DummyJUnit5(klass, testMethods)
}

You must be logged in to vote

The reason why you cannot run JUnit Jupiter tests below API 26 is that JUnit 5 uses several APIs that aren't available on devices shipping with Java 7 or older, and the fact that these APIs aren't completely covered by core library desugaring either. For example, the upcoming release candidate for JUnit 5.11 will fail right on discovery becauseClass#getTypeName cannot be found on older devices. Because of this, it's not a matter of excluding onlysome functionality since the main entry point fails immediately.

That being said, I'd love to see this sample project of yours if you can share it!

Replies: 1 comment 1 reply

Comment options

The reason why you cannot run JUnit Jupiter tests below API 26 is that JUnit 5 uses several APIs that aren't available on devices shipping with Java 7 or older, and the fact that these APIs aren't completely covered by core library desugaring either. For example, the upcoming release candidate for JUnit 5.11 will fail right on discovery becauseClass#getTypeName cannot be found on older devices. Because of this, it's not a matter of excluding onlysome functionality since the main entry point fails immediately.

That being said, I'd love to see this sample project of yours if you can share it!

You must be logged in to vote
1 reply
@bddckr
Comment options

becauseClass#getTypeName cannot be found on older devices

Ah, too bad. That alone makes this whole path futile. My example is so basic, it probably just didn't run into any of those issues just yet.

Thanks for the quick reply! I'll just consider ignoring API level 25 for my project.

Answer selected bybddckr
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@bddckr@mannodermaus

[8]ページ先頭

©2009-2025 Movatter.jp