iamsteveholmes
06/25/2021, 7:45 PMiamsteveholmes
06/25/2021, 9:27 PMElka
06/26/2021, 12:59 PMimplementation
dependencies specified in submodules are exported when transitiveExport = true
? Shouldn’t it only export dependencies marked with api
?Francis Mariano
06/26/2021, 2:27 PMexpect fun String.formatPlatform(vararg args: Any?): String
and on iosMain module I wrote the actual function
actual fun String.formatPlatform(vararg args: Any?): String {
return NSString.create(format = this, args = arrayOf(args)).toString()
}
But when I compile that code I get this error : kotlin.Array<out kotlin.Any?> is not supported here: doesn't correspond to any C type
I tried to change the parameter type from expect function to Float or Double, but the error continues: kotlin.Array<out kotlin.Float?> is not supported here: doesn't correspond to any C type
I read the issue https://github.com/JetBrains/kotlin-native/issues/1834 but I do not solve the problem. Can anyone help me with that? Thank you.saket
06/26/2021, 5:59 PMSourabh Rawat
06/27/2021, 1:10 PMhttps://www.youtube.com/watch?v=s5qnlv8hzH8▾
bootRun
gradle task?
Its not visible in available tasks.Robert Munro
06/28/2021, 6:40 AMjvmMain
and an androidMain
source folder in my shared module. It seems like l have to duplicate the actual class declaration in both jvmMain and androidMain as if I just have the jvm version the expected class says something like "there isnt an actual declaration for jvm" (referring to androidMain). If i delete my android source set and gradle declaration the shared library complains about a missing AndroidManifest.xml
.
So just wondering if it is normal that i would have to duplicate androidMain
and jvmMain
Carson Holzheimer
06/28/2021, 7:49 AMerror: no such module 'KotlinCommon'
while building for Bitrise tests.
Tests run fine locally on simulator and device.
I have a kotlin module in my iOS app, using the cocoapods plugin. Module seems to build fine with BUILD SUCCESSFUL
Any ideas?Napa Ram
06/28/2021, 9:52 AMHossein Amini
06/28/2021, 11:29 AMio.ktor.client.features.ClientRequestException
.
This is my code:
httpClient.request("https://...") {
method = <http://HttpMethod.Post|HttpMethod.Post>
header("Authorization", "access token")
}
What’s wrong with this code?Nicolas Verinaud
06/28/2021, 1:10 PMAndroid Studio 4.2.1 / KMM Plugin 0.2.6
Toby
06/28/2021, 2:24 PMAtomicReference
from the native library? I do not have access to a (getter and) setter. Would I have to implement my own AtomicReference into my project to make it work?Jérémy CROS
06/28/2021, 3:36 PMspierce7
06/28/2021, 9:34 PMjvm()
target, its source code can’t be used.Napa Ram
06/29/2021, 4:32 AMatsushieno
06/29/2021, 9:20 AMStefan Oltmann
06/29/2021, 11:45 AMExecution failed for task ':shared:allTests'.
> Failed to execute all tests:
:shared:iosX64Test: java.lang.IllegalStateException: command '/usr/bin/xcrun' exited with errors (exit code: 148)
Alberto
06/29/2021, 2:30 PMStefan Oltmann
06/29/2021, 2:56 PMstruct ContentView: View {
@EnvironmentObject var store: ObservablePhotoStore
var body: some View {
VStack {
Button("Show details") {
store.dispatch(PhotoAction.Refresh())
}
}
onReceive(store.$state) { value in
print("test")
}
}
}
This is the observerved object:
class ObservablePhotoStore: ObservableObject {
@Published public var state: PhotoState = PhotoState(progress: false, photos: [], selectedPhoto: nil, testString: "never updated")
@Published public var sideEffect: PhotoSideEffect?
let store: PhotoStore
var stateWatcher : Closeable?
var sideEffectWatcher : Closeable?
init(store: PhotoStore) {
self.store = store
stateWatcher = self.store.watchState().watch { [weak self] state in
self?.state = state
}
sideEffectWatcher = self.store.watchSideEffect().watch { [weak self] state in
self?.sideEffect = state
}
}
public func dispatch(_ action: PhotoAction) {
store.dispatch(action: action)
}
deinit {
stateWatcher?.close()
sideEffectWatcher?.close()
}
}
@main
class MyPhotoApp: App {
let photoRepository: PhotoRepositoryImpl
let store: ObservablePhotoStore
required init() {
photoRepository = PhotoRepositoryImpl()
store = ObservablePhotoStore(store: PhotoStore(photoRepository: photoRepository))
}
var body: some Scene {
WindowGroup {
ContentView().environmentObject(store)
}
}
}
I'm new to SwitUI and I try to learn from https://github.com/Kotlin/kmm-production-sample how to receive changes in StateFlow to update my Swift UI.
I'm looking for a simple way to do that and that sample project is already very complex.Justin Yue
06/29/2021, 6:16 PMDaniele B
06/29/2021, 7:31 PMOsman Saral
06/29/2021, 8:09 PMNo tests found for given includes
error when I try to run my tests.
As far as I could find, solutions proposed for this error are:
1. Adding useJUnitPlatform()
to build.gradle. I'm using junit4 and this doesn't work
2. import org.junit.jupiter.api.Test
instead of import org.junit.Test
. Same as above
3. change setting Gradle -> Run Tests Using' from 'Gradle (default)' to 'IntelliJ IDEA'. This setting is not there on Android Studio Arctic Fox or Bumblebee
I've tried to copy all the test related codes from KaMPKit and using exactly the same dependency versions as this branch. Same tests run on KaMPKit project but not on my project.
Did anyone get this error before? What am I doing wrong?Devendra Patel
06/29/2021, 8:24 PMmParticle
library cocoapod in Kotlin Multiplatform project but am seeing following error
Execution failed for task ':shared:cinteropMParticle-Apple-SDKIos'.
> Process 'command '/Applications/Android <http://Studio.app/Contents/jre/jdk/Contents/Home/bin/java|Studio.app/Contents/jre/jdk/Contents/Home/bin/java>'' finished with non-zero exit value 1
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':shared:cinteropMParticle-Apple-SDKIos'.
....
Does anyone have an insight on how I can fix this issue? Thanksitnoles
06/30/2021, 3:13 AMjava.lang.IllegalStateException: org.jetbrains.kotlin.resolve.multiplatform.ExpectedActualResolver@3af53289
?Stefan Oltmann
06/30/2021, 10:07 AMPHAsset.fetchAssets(with: .image, options: *nil*)
but photos synced from my Mac (shown as "From my mac" in the gallery) are not contained there. How do I fetch also these photos?Lena Stepanova
06/30/2021, 10:51 AMclass LocalApi (log: Kermit) : LocalKtorApi {
private var localUrl = ""
// If this is a constructor property, then it gets captured
// inside HttpClient config and freezes this whole class.
@Suppress("CanBePrimaryConstructorProperty")
private val log = log
private val client = HttpClientProvider().getHttpClient(localUrl).config {
defaultRequest {
host = ""
header(HttpHeaders.ContentType, ContentType.Application.Json)
url {
//protocol = URLProtocol.HTTPS
}
}
install(JsonFeature) {
accept(ContentType.Text.Plain)
val json = Json {
ignoreUnknownKeys = true
useAlternativeNames = false
}
serializer = KotlinxSerializer(json)
}
install(Logging) {
logger = object : Logger {
override fun log(message: String) {
log.v("Network") { message }
}
}
level = LogLevel.ALL
}
}
init {
ensureNeverFrozen()
}
override suspend fun verifyLocalCredentials(url: String, credentials: String) {
localUrl = url
log.v { "credentials: $credentials" }
return client.get {
url(path = "/apps")
header("Authorization", "Basic $credentials")
}
}
}
May be the problem is with ios HttpClient? Because it's simply
actual class HttpClientProvider actual constructor() {
actual fun getHttpClient(
host: String
): HttpClient {
return HttpClient(Ios){}
}
}
Jérémy CROS
06/30/2021, 12:20 PM* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Failed to calculate the value of task ':compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /Users/jeremy/perso/projects/untitled/build/generated/ap_generated_sources/debug/out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@5cf2ca8c) before task ':compileDebugJavaWithJavac' has completed is not supported
I’ll add the entire gradle file in a thread, in case anyone has the slighest idea 🙂
Thanks! 🙂Alberto
06/30/2021, 6:48 PMobject::class
I only get class <anonymous>
so calling any of the ::simpleName
or calling getOriginalClassName
on it just returns nullRak
07/01/2021, 3:25 AMNapa Ram
07/01/2021, 7:46 AMNapa Ram
07/01/2021, 7:46 AMStefan Oltmann
07/01/2021, 8:56 AMNapa Ram
07/01/2021, 8:58 AMMejdi
07/05/2021, 5:00 PM