Мой проект представляет собой библиотеку Android, поэтому, естественно, у меня есть
Код: Выделить всё
plugins { id 'com.android.library' }
Код: Выделить всё
build.gradle
Код: Выделить всё
import java.net.http.HttpClient;

Indeed, I am aware that Android platform includes not even nearly all JDK classes, especially those found in newer JDKs.
But that applies only to the code which runs in Android, doesn't it? A unit test which runs on my host machine (i.e. not in Android but in the JDK) - why would it not see
Код: Выделить всё
java.net.http.HttpClient
I want to use such JDK classes in my unit tests. Is there a magic line in Gradle that I miss?
Источник: https://stackoverflow.com/questions/781 ... id-project