Using IntelliJ IDEA Ultimate 2020.3 I've created a KMM project from File->New...->Project. Then, I added ktor as dependencies exactly as you did in the code included in your question. When creating an ApiClient
class just like yours, it worked for me both in the androidMain
as well as the commonMain
source set, with IDEA automatically importing HttpClient
.
So since I cannot reproduce this, I fear that without knowing the exact code you are running I'll have a tough time helping.
However, just in case it might be of some help, I've put my minimal project on Github (here), maybe you can find a hint there.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…