ribesg
04/23/2019, 3:02 PMfun HttpRequestBuilder.useAuthentication() { ... }
HttpRequestBuilder
is from Ktor client.
I’m trying to use it in another project which has the above one as a dependency:
private suspend fun postUploadFile(successUrl: String): Unit =
<http://http.post|http.post>(successUrl) {
useAuthentication()
}
http
is a Ktor HttpClient
.
IntelliJ IDEA sees the extension, imported it alone without me doing anything, everything works inside IntelliJ. Then I tried to build.
> Task :compileDebugKotlinAndroid FAILED
e: <myFile>.kt: (9, 37): Unresolved reference: useAuthentication
The reference position is in the imports.
What could cause that? I’m posting here because I have no idea where to start. It only seem to happen for this top level extension right now. Maybe it’s a Gradle metadata issue? But then why would IntelliJ see it?hho
04/23/2019, 3:04 PMribesg
04/23/2019, 3:06 PMhho
04/23/2019, 3:07 PMribesg
04/23/2019, 3:07 PMhho
04/23/2019, 3:08 PMribesg
04/23/2019, 3:09 PMribesg
04/23/2019, 3:10 PMsnowe
04/23/2019, 3:25 PMribesg
04/23/2019, 3:48 PMribesg
04/24/2019, 8:37 AMval test = 42
in the same file and same issue. IntelliJ sees it but not Gradle. So it’s not related to it being an extension nor to ktor. Can still be related to it being top level and/or multiplatform context mayberibesg
04/24/2019, 8:39 AMobject Test { val test = 42 }
and that worked! So it’s due to it being top level.ribesg
04/24/2019, 8:41 AMobject
is visible?Dennis L
04/24/2019, 8:47 AMribesg
04/24/2019, 8:51 AMimplementation
to api
for my parent lib in the child lib build file and see if it does anythingribesg
04/24/2019, 8:52 AMapi
because I don’t know what it does and never needed it...Julien Cayzac
04/24/2019, 8:57 AMuseAuthentication
?Julien Cayzac
04/24/2019, 8:57 AMribesg
04/24/2019, 8:58 AMribesg
04/24/2019, 8:59 AMribesg
04/24/2019, 9:00 AMpackagingOptions {
exclude("META-INF/*.kotlin_module")
}
This should not be set on libraries, only on apps. I had it set on a library.