pardom
02/21/2019, 3:09 PMDico
02/21/2019, 10:06 PM.idea/
folder. A project with JVM targets as well as native targets where you want to debug the application is the subject.josephivie
02/22/2019, 3:27 AMpublishLibraryVariants("release")
, I keep getting org.gradle.api.UnknownDomainObjectException: KotlinJvmAndroidCompilation with name 'release' not found.
. If I attempt to create one manually in the line above using compilations.create("release")
, it gives Cannot add a KotlinJvmAndroidCompilation with name 'release' as a KotlinJvmAndroidCompilation with that name already exists.
If I just read the compilations before hand, I can see that there are none.
Can anyone help? I've been investigating this for a couple hours nowaltavir
02/22/2019, 9:03 AMclass org.jetbrains.kotlin.gradle.plugin.mpp.HierarchyAttributeContainer cannot be cast to class org.gradle.api.internal.attributes.AttributeContainerInternal
for both JVM and JS metadata generation. Where does it come from?ribesg
02/22/2019, 9:24 AMError
protocol in the ios part of my MPP project? NOT NSError
Sabrina Namur
02/22/2019, 10:47 AMDiego
02/22/2019, 2:46 PMByteArray
but on the iOS world it is converted to KotlinByteArray
and not to NSData
. In the Kotlin world I have the following extensions to convert ByteArray
to NSData
and visceversa.
private fun ByteArray.toNSData(): NSData = memScoped {
return NSData.create(
bytes = toCValues().getPointer(this),
length = size.toUInt()
)
}
private fun NSData.toByteArray(): ByteArray = memScoped {
val size = length.toInt()
val nsData = ByteArray(size)
memcpy(nsData.refTo(0), bytes, size.toUInt())
return nsData
}
Does someone know how I can convert KotlinByteArray
to NSData
and visceversa in Swift? 🙂natpryce
02/22/2019, 5:11 PMkpgalligan
02/22/2019, 6:09 PMorangy
02/22/2019, 10:08 PMjuancho
02/23/2019, 3:18 AMlouiscad
02/23/2019, 1:24 PMbasher
02/24/2019, 1:40 AMNikky
02/24/2019, 6:32 AMorangy
02/24/2019, 9:23 PMdarkmoon_uk
02/25/2019, 2:48 AMjvmMain
source set - I'm assuming I want to define additional JVM targets to separate the Android/JavaFX dependencies (e.g. androidMain
and javafxMain
and avoid using jvmMain
to avoid ambiguity) ? Can anyone confirm this the way to go + any caveats/suggestions?natpryce
02/25/2019, 1:43 PMspand
02/25/2019, 1:53 PMexpect class Foo {
companion object {
fun of() : Foo
}
}
actual typealias Foo = java.lang.String
serebit
02/25/2019, 6:09 PMios.gradle.kts
as wellKris Wong
02/25/2019, 10:44 PMjuancho
02/26/2019, 3:42 AMExceptions in Multiplatform
(for the JVM target).
I have a multiplatform lib with a method that can throw a custom exception. In Java code I’m using that method surrounded with a try/catch. I was expecting that custom exception to arrive but it was not working. I just added another catch with a general Throwable
exception, now it worked and also what got my attention is that it’s a RuntimeException
where the cause
has my CustomException, so I can access it from there but it’s kind of annoying. Does anyone know how to improve this?
So it looks like this:
try {
return mppApi.getSomethingWithExceptionInMultiplatform();
} catch (MyCustomException e) {
// never gets here...
} catch (Throwable e) {
if (e.getCause() instanceof MyCustomException) {
// here I can access my custom exception fields with
// ((MyCustomException) e.getCause())
}
throw e;
}
galex
02/26/2019, 10:16 AMribesg
02/26/2019, 11:13 AM> Task :linkReleaseFrameworkIos
ld: framework not found Bugsnag
Kris Wong
02/26/2019, 4:28 PMnestserau
02/26/2019, 4:38 PMklib
under the ios
category. I build my fat frameworks using this code: https://gist.github.com/benasher44/32f602b9d5ec596ceaa3c9d190b14fc9 Kudos to @basher Further I’ve added a couple of extra tasks to create a zip to be consumed by CocoaPods:
task("zipIos${config}Artifacts", dependsOn: "createIos${config}Artifacts", group: "iOS", type: Zip) {
archiveFileName = "${rootProject.name}${"debug".equalsIgnoreCase(config) ? '-debug' : ''}.zip"
destinationDirectory = file("$outputDir/..")
from outputDir
}
And now I’m stuck. How do I tell the maven-publish
plugin to also include the artifacts produced by zipIosDebugArtifacts
and zipIosReleaseArtifacts
tasks? If I read these docs https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#publishing-a-multiplatform-library it concerns configuring targets, but that’s not something that is useful for me, since my artifact is a result of multiple targets.pardom
02/26/2019, 4:38 PMlouiscad
02/27/2019, 6:23 AMExecution failed for task ':modules:name-of-my-module:generateMetadataFileForJvmPublication'.
> org.jetbrains.kotlin.gradle.plugin.mpp.HierarchyAttributeContainer cannot be cast to org.gradle.api.internal.attributes.AttributeContainerInternal
(I also reported it here: https://youtrack.jetbrains.com/issue/KT-30158?project=kt)natpryce
02/27/2019, 8:26 AMpublic interface Document extends Node
). On the JS platform it is defined as abstract classes (e.g. public external open class Document : Node, ...
). This makes it impossible to write multiplatform code that uses DOM elements, and also impossible to write expect/actual declarations for DOM elements in common code. Is there a workaround or other API that can be used to work with XML in multiplatform projects?josephivie
02/27/2019, 9:10 AMbasher
02/27/2019, 6:05 PMcommonTest
on JVM/Android? One class is an expect/actual class. The other is an object
. Both are in commonMain
basher
02/27/2019, 6:05 PMcommonTest
on JVM/Android? One class is an expect/actual class. The other is an object
. Both are in commonMain