Bradleycorn
05/13/2021, 7:51 PMpackage.json
files have a few problems:
1. they have dependencies with “hardcoded” absolute file paths, like: "kotlin": "file:/Users/brad.ball/dev/multiplatform/new/wager-utils/build/js/packages_imported/kotlin/1.5.0",
2. the dependencies list contains entries for kotlin-test-js-runner
and kotlin-test
. Why would those be dependencies for a published package? Seems like at best they should be devDependencies.
With the hard coded file paths, you can’t really publish the package or use it anywhere but on the machine where it was generated…
The full package.json output is included in the replies thread…
Am I doing something wrong? I have a pretty standard gradle config, haven’t really changed much from what was produced by IntelliJ when creating the project.Tom Wayne
05/14/2021, 9:31 AM2021-05-14 10:05:02.962001+0200 sts[1040:3855803] KMP_ClosedTicket: state: loading
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
It is considered unexpected and unhandled instead. Program will be terminated.
Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen com.betsys.util.PlatformCache@28c4da8
The PlatformCache object which throws this error looks like this:
object PlatformCache {
var isLogsEnabled: Boolean = false
private set
fun setIsLogEnabled(isEnabled: Boolean) {
isLogsEnabled = isEnabled
}
}
As far as I understand this error is thrown when our logger instance acces the isLogsEnabled field from Logger.
actual open class Logger {
actual companion object {
actual val INSTANCE: Logger
get() = Logger()
}
actual open fun v(msg: String) {
log(msg)
}
actual open fun d(msg: String) {
log(msg)
}
actual open fun i(msg: String) {
log(msg)
}
actual open fun w(msg: String) {
log(msg)
}
actual open fun e(error: Throwable, msg: String) {
log(msg, error)
}
private fun log(msg: String, error: Throwable? = null) {
// Set by BSPlatform
if (PlatformCache.isLogsEnabled) {
if (error == null) {
println("❤️ KMPLog: $msg")
} else {
println("❤️ KMPLog: $msg error: ${error.message}")
}
}
}
}
Do you have some idea on how to avoid this crash? I do not know anything about freezing in K/N. 🙂Fernando Angli
05/14/2021, 8:03 PMJeff Tycz
05/14/2021, 11:56 PMDominaezzz
05/16/2021, 10:48 AM-Xopt-in=kotlin.RequiresOptIn
in multiplatform projects? IntelliJ annoyingly keeps asking me to add it but I have.
targets.all {
compilations.all {
kotlinOptions {
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
}
}
}
sushma nayak
05/16/2021, 1:32 PMarchana 0623
05/16/2021, 2:46 PMiamthevoid
05/17/2021, 7:11 AMAn exception occurred applying plugin request [id: ‘com.google.firebase.crashlytics’]
> Failed to apply plugin ‘com.google.firebase.crashlytics’.
> Applying the Firebase Crashlytics plugin to a library project is unsupported. It should only be applied to the application module of your project to enable automatic upload of obfuscation mapping files for your application.
Christian Gaisl
05/17/2021, 10:42 AMPaul Woitaschek
05/17/2021, 1:03 PMPhilipp Mayer
05/17/2021, 3:36 PMcommonMain
. I can't use kotlin.test.Test
.
I followed https://kotlinlang.org/docs/gradle.html#set-dependencies-on-test-libraries, which resulted in the following `build.gradle.kts`:
kotlin {
android()
jvm("desktop") {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
}
sourceSets {
jvm {
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
...
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation("io.kotest:kotest-assertions-core:${Versions.kotest}")
}
}
...
The project overall is pretty empty, as in there are only the basic build steps.
I looked up some other example repositories and also refreshed the dependencies, but it seems that I have missed something.
I would be more than happy if anyone has a heads up of what might be wrong. Thanks in advance!atsushieno
05/17/2021, 6:48 PMrb90
05/17/2021, 6:50 PMDaniele B
05/17/2021, 10:58 PMJeff Tycz
05/17/2021, 11:28 PMExecution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve io.github.tyczj:tweedle-android:0.3.0.
Required by:
project :app
> No matching variant of io.github.tyczj:tweedle-android:0.3.0 was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'commonMainMetadataElements-published' capability io.github.tyczj:tweedle-android:0.3.0:
- Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
- Variant 'metadataApiElements-published' capability io.github.tyczj:tweedle-android:0.3.0:
- Incompatible because this component declares a usage of 'kotlin-metadata' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
- Variant 'releaseApiElements-published' capability io.github.tyczj:tweedle-android:0.3.0 declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
- Variant 'releaseRuntimeElements-published' capability io.github.tyczj:tweedle-android:0.3.0 declares a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
The KMM module works fine if the app references it locally. I am not sure what I need to do to be able to use the Android dependency correctly, this is my first time making a KMM libraryNapa Ram
05/18/2021, 8:42 AMBen Lancaster
05/18/2021, 2:31 PMMyProject
├── Library
├── Library-common
├── Library-submodule
└── Library-submodule-with-cinterops # has a cinterop def for a native dependency, let's call it Foo
The idea is that Library depends on Library-submodule
and Library-submodule-with-cinterops
, both of which depend on Library-common
. All is working fine, with the exception of the Library-submodule-with-cinterops
. I can build that module in isolation, which generates the .aar, .framework files, and .klibs, but when I build Library
, the linker fails with the following:
The /Applications/Xcode <http://11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld|11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld> command returned non-zero exit code: 1.
output:
ld: framework not found Foo
I’m not sure why -framework Foo
is being added to the ld
command (executed as part of :Library:linkReleaseFrameworkApple
), I’m guessing I need to tell the linker where to find it, but I’m not sure how to go about it. Does anyone have any pointers for how I might fix it?Tiago Nunes
05/18/2021, 4:37 PMBoris Yordanov
05/18/2021, 6:58 PMNapa Ram
05/19/2021, 6:41 AMAkshat Sharma
05/19/2021, 10:24 AMCharles Prado
05/19/2021, 11:45 AMBarry Fawthrop
05/19/2021, 7:47 PMrb90
05/19/2021, 8:19 PMRémy
05/20/2021, 9:21 AMTom Wayne
05/20/2021, 9:44 AMTask :kmpcorelib:linkDebugFrameworkIosArm64
> Task :kmpcorelib:linkDebugFrameworkIosX64
> Task :kmpcorelib:linkKMPCoreDebugFrameworkIosArm64
> Task :kmpcorelib:linkKMPCoreDebugFrameworkIosX64
> Task :kmpcorelib:linkKMPCoreReleaseFrameworkIosArm64
> Task :kmpcorelib:linkKMPCoreReleaseFrameworkIosX64
> Task :kmpcorelib:linkReleaseFrameworkIosArm64
> Task :kmpcorelib:linkReleaseFrameworkIosX64
My question is: Is there a way how to run the app on iOS simulator without running all these task?
I dont know why the studio needs to link the RELEASE version of the framework. Also I dont understand why it has to run the iOSArm64 variants when its running the on the X64 simulator.
Also whats the difference between running linkDebugFrameworkIosArm64
and linkKMPCoreDebugFrameworkIosArm64
isnt it duplication?
PS: I run the iOS buld via clicking the default configuration in Android studio. Not some custom gradle scriptTiago Nunes
05/20/2021, 10:44 AMHelena Kot
05/20/2021, 1:18 PMBen Woodworth
05/20/2021, 9:15 PMdesktop
with dependsOn(common)
, and all the *_x64 source sets with dependsOn(desktop)
, but I'm not sure how to use the platform libs in desktop
common
- jvm
- js
- desktop (uses platform.zlib)
- linux_x64
- mingw_x64
- macos_x64
xxfast
05/21/2021, 1:44 AMxxfast
05/21/2021, 1:44 AMAbhishek Dewan
05/21/2021, 1:47 AMxxfast
05/21/2021, 1:50 AMswitch progressState.step {
case .checkingcredentials:
ProgressView("Checking credentials")
case .registeringdevice:
ProgressView("Registering device")
case .updatingmanifests:
ProgressView("Updaing manifests")
default:
ProgressView("Loading")
}
Abhishek Dewan
05/21/2021, 1:51 AMdarkmoon_uk
05/21/2021, 6:50 AM