Bailey Pollard
08/19/2021, 10:10 AMPeter Hsu
08/19/2021, 8:42 PMsmallshen
08/20/2021, 9:32 AMrachael
08/20/2021, 8:54 PMNikola Milovic
08/21/2021, 7:16 PM> Task :web-app:compileDevelopmentExecutableKotlinJs FAILED
e: Module <dev.gitlive:firebase-auth> is a module[ModuleDescriptorImpl@62ac83c2] has reference public dev.gitlive.firebase.auth/FirebaseUser.displayName.<get-displayName>|-7122534302014937473[1], unfortunately neither itself nor its dependencies [
org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsIrLinker$JsModuleDeserializer@5b30eb79
org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsIrLinker$JsModuleDeserializer@17c9428e
org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsIrLinker$JsModuleDeserializer@4974c
org.jetbrains.kotlin.backend.common.serialization.IrModuleDeserializerWithBuiltIns@5d0478f0
] contain this declaration
Please check that project configuration is correct and has required dependencies.
The library in question ( I have it locally downloaded so I can probably edit it as needed). I've had similar errors but they were due to coroutines version mismatch, this seems like it's something else.Slackbot
08/23/2021, 7:35 AMagta1991
08/23/2021, 9:34 AMJonas Frid
08/23/2021, 1:15 PMmagnumrocha
08/24/2021, 2:10 PM> Task :shared:compileDebugAndroidTestKotlinAndroid
e: /.../shared/src/commonTest/kotlin/<package>/Utils.kt: (5, 12): Expected function 'myExpectFunction' has no actual declaration in module <shared_debug> for JVM
> Task :shared:compileDebugAndroidTestKotlinAndroid FAILED
I am with the latest version of kotlin gradle plugin (1.5.21) and android gradle plugin (7.1.0-alpha09)
I have no JVM targets setup on my kotlin plugin….simon.vergauwen
08/24/2021, 3:32 PMEmiliano Schiavone
08/24/2021, 8:39 PMmagnumrocha
08/24/2021, 8:47 PM> Task :shared:compileDebugAndroidTestKotlinAndroid FAILED
...has no actual declaration in module <shared_debug> for JVM
I have no jvm
target set on the kotlin
plugin, only android
and ios
targets, by the name of this task compileDebugAndroidTestKotlinAndroid
what is it trying to do?jdoneill
08/25/2021, 2:14 AMorg.gradle.api.GradleException: Please initialize the Kotlin/JS target in 'web (:web)'. Use:
kotlin {
js {
// To build distributions and run tests for browser or Node.js use one or both of:
browser()
nodejs()
}
}
Sergei Popyvanov
08/25/2021, 6:23 AMinterface SharedInterface {
val propertyA: Int
}
class SharedService() {
fun equals(actual: SharedInterface, expected: SharedInterface){
return actual.equals(expected)
}
}
Swift:
final class SharedInterfaceImpl: SharedInterface, Equatable {
let propertyA: Int
static func == (lhs: SharedInterfaceImpl, rhs: SharedInterfaceImpl) -> Bool {
lhs.propertyA == rhs.propertyA
}
}
// some code in iOS main class
let actual = SharedInterfaceImpl(1)
let expected = SharedInterfaceImpl(1)
print(actual == expected) // true
print(SharedService().equals(actual, expected)) //false
Skolson5903
08/25/2021, 9:26 AMMatthias Geisler
08/25/2021, 12:03 PMjean
08/25/2021, 2:30 PMoverride val isExecutable: (LoginViewState) -> Boolean = {
it.isLoading &&
it.email.value.isNotEmpty() &&
it.password.value.isNotEmpty()
}
when I put a break point within the lambda and test it.email.value.isNotEmpty()
I get the following error
org.jetbrains.kotlin.codegen.CompilationException : Back-end (JVM) Internal error: Failed to generate expression: KtCallExpression
File being compiled: (1,16) in /fragment.kt
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$Companion.getPackageMemberContainingClassesInfo(KotlinTypeMapper.kt:1402)If I replace
it.email.value.isNotEmpty()
by it.email.value.length > 0
it works.
What am I doing wrong here?
PS : I get this error in my KMM project but I feel it’s more of a kotlin-wide issue. Now that general
is read-only, where am I suppose to ask this kind of questions?Sam
08/25/2021, 6:45 PMNo matching variant of org.jetbrains.kotlinx:kotlinx-serialization-core:1.2.2 was found. The consumer was configured to find a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64'
Alan Keiss
08/26/2021, 1:30 PMiOS 14
✅ but with iOS 15
❌ I am facing a kotlin.native.IncorrectDereferenceException
crash.
Is there anyone who experienced the same issue?Emiliano Schiavone
08/26/2021, 6:21 PMshared:compileKotlinIos FAILED
Could not resolve io.ktor:ktor-client-core:1.6.1.
brabo-hi
08/28/2021, 12:55 AMimplementation("androidx.datastore:datastore-preferences-core:1.0.0")
however i am not being able to get autocompletion with android studio, that doesn’t seem to recognize itbrabo-hi
08/28/2021, 1:07 AMcommonMain
but i can access it within androidMain
atsushieno
08/28/2021, 9:59 AMsrc/commonMain/resources
from native executable built as binaries.executable()
?edwinRNDR
08/28/2021, 5:04 PMBig Chungus
08/29/2021, 12:21 AMWilliam Persall
08/29/2021, 2:01 AMExecution failed for task ':run'.
> Process 'command 'C:\Users\folder\.jdks\liberica-1.8.0_302\bin\java.exe'' finished with non-zero exit value 1
not sure how to diagnose what the cause it, would someone be able to assist?Viktor Petrovski
08/29/2021, 7:02 AMsimon.vergauwen
08/31/2021, 11:26 AMMihail Krivov
08/31/2021, 4:40 PMval ios = listOf(iosX64(), iosArm64())
configure(ios) {
binaries{
framework{
baseName = "commonModule"
}
}
}
...
...
val iosX64Main by getting{
dependencies{
...kotlinx-coroutines-core-native:1.3.5
...ktor-client-ios:1.6.1
...sqldelight:native-driver:1.5.0
}
val iosArm64Main by getting{
dependsOn(iosX64Main)
}
OR
ios {
binaries{
framework{
baseName = "commonModule"
}
}
}
val iosMain by getting{
dependencies{
...kotlinx-coroutines-core-native:1.3.5
...ktor-client-ios:1.6.1
...sqldelight:native-driver:1.5.0
}
OR any structure u prefer
And regardless of type u prefer, xCode everytime return error when try to build project
like
task embedAndSignAppleFrameworkForXcode not found
OR
NVActivityIndicatorView not found for target x86_64-apple-ios-simulator
OR
one time I saw error like DatabaseDriverFactory has no dependencies
OR
Execution failed for task ":commonModule:compileKotlinIosX64"
OR
etc...
So... can any1 explain me what I need to do?! I feel like a blind kitten and constantly bump into walls 🤕Carson Holzheimer
09/01/2021, 5:53 AM* What went wrong:
Task 'Debug' not found in root project 'KotlinCommon'.`
Why is it looking for a task called Debug???Carson Holzheimer
09/01/2021, 5:53 AM* What went wrong:
Task 'Debug' not found in root project 'KotlinCommon'.`
Why is it looking for a task called Debug???Luis
09/01/2021, 6:20 AMDebug
configuration, so maybe try changing it to DEBUG
all capsCarson Holzheimer
09/01/2021, 7:50 AMxcodeConfigurationToNativeBuildType["CUSTOM_DEBUG"] = NativeBuildType.DEBUG
I have mapped all the configurations. Even "Debug" by itself, tho it is not one of my configsViacheslav Kormushkin
09/01/2021, 8:12 PMLuis
09/01/2021, 11:15 PMnoPodspec()
in your shared mmp build.gradle, then edit the podspec file script to do the string manipulation thereCarson Holzheimer
09/02/2021, 4:18 AMcocoapods {
// Configure fields required by CocoaPods.
summary = "Shared Kotlin code across iOS and Android"
homepage = "redacted"
ios.deploymentTarget = "12.0"
podfile = project.file("../Podfile")
framework {
baseName = "KotlinCommon"
isStatic = true
}
val apps = listOf("DMS", "WFM")
val schemes = listOf("Prod", "Beta", "Labs", "QA")
val listOfDebugConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Debug ($scheme)"
}
}
val listOfReleaseConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Release ($scheme)"
}
}
// Not sure why these are required but build fails without it
xcodeConfigurationToNativeBuildType["WFM"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
xcodeConfigurationToNativeBuildType["DMS"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
xcodeConfigurationToNativeBuildType["Debug"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
listOfDebugConfigs.forEach {
xcodeConfigurationToNativeBuildType[it] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
}
listOfReleaseConfigs.forEach {
xcodeConfigurationToNativeBuildType[it] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.RELEASE
}
}
Luis
09/02/2021, 4:26 AMCarson Holzheimer
09/02/2021, 4:28 AMLuis
09/02/2021, 4:28 AMval listOfDebugConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Debug ($scheme)"
}
}
val listOfReleaseConfigs = apps.flatMap { app ->
schemes.map { scheme ->
"$app Release ($scheme)"
}
}
Carson Holzheimer
09/02/2021, 4:42 AMPod::Spec.new do |spec|
spec.name = 'KotlinCommon'
spec.version = '1.0'
spec.homepage = 'redacted'
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
spec.authors = ''
spec.license = ''
spec.summary = 'Shared Kotlin code across iOS and Android'
spec.vendored_frameworks = "build/cocoapods/framework/KotlinCommon.framework"
spec.libraries = "c++"
spec.module_name = "#{spec.name}_umbrella"
spec.ios.deployment_target = '12.0'
spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':',
'PRODUCT_MODULE_NAME' => 'KotlinCommon',
}
spec.script_phases = [
{
:name => 'Build KotlinCommon',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$COCOAPODS_SKIP_KOTLIN_BUILD" ]; then
echo "Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration=$CONFIGURATION \
-Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
-Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
SCRIPT
}
]
end
/bin/sh -c /Users/carsonholzheimer/Library/Developer/Xcode/DerivedData/RedEye-bnxkyzimuyxvsiczcehnvfezhktc/Build/Intermediates.noindex/Pods.build/WFM\\\ Debug\\\ \\\(QA\\\)-iphonesimulator/KotlinCommon.build/Script-B9E7066122875376ACF9D124F6326B2D.sh
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME -Pkotlin.native.cocoapods.archs="$ARCHS" -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" -Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" -Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
> Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: <https://kotlinlang.org/docs/reference/evolution/components-stability.html>. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
FAILURE: Build failed with an exception.
* What went wrong:
Task 'Debug' not found in root project 'KotlinCommon'.
/bin/sh -c /Users/carsonholzheimer/Library/Developer/Xcode/DerivedData/RedEye-ediatwizneiykycbhcshsflepmrj/Build/Intermediates.noindex/Pods.build/WFM\\\ Debug\\\ \\\(QA\\\)-iphonesimulator/KotlinCommon.build/Script-76194415D0376B6F6C5FC66A6A58DEE6.sh
APP_BUILD="$CONFIGURATION"
if [[ APP_BUILD == *"Debug"* ]]
then
APP_BUILD="DEBUG"
else
APP_BUILD="RELEASE"
fi
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/gradlew" -p "$REPO_ROOT" ::syncFramework -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET -Pkotlin.native.cocoapods.configuration=$APP_BUILD -Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" -Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" -Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
> Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: <https://kotlinlang.org/docs/reference/evolution/components-stability.html>. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
Unable to detect Kotlin framework build type for CONFIGURATION=WFM Debug (QA) automatically. Specify 'KOTLIN_FRAMEWORK_BUILD_TYPE' to 'debug' or 'release'
The Kotlin source set androidAndroidTestRelease was configured but not added to any Kotlin compilation. You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
See <https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets>
> Task :compileKotlinIosX64
> Task :linkReleaseFrameworkIosX64
> Task :syncFramework
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD SUCCESSFUL in 29s
Luis
09/02/2021, 7:03 AM"$app Debug ($scheme)"
in your build.gradle, you should try to do something like "$app\\ Debug\\ ($scheme)"
or maybe "\"$app Debug ($scheme)\""
$CONFIGURATION
variable in the scriptCarson Holzheimer
09/02/2021, 7:04 AMLuis
09/02/2021, 7:05 AM$CONFIGURATION
with WFM Debug (QA)
but because it has spaces it breaks the scriptWFM
and then it tries to run the “task” Debug
because of the spacesCarson Holzheimer
09/02/2021, 7:07 AMLuis
09/02/2021, 7:10 AMCarson Holzheimer
09/03/2021, 3:02 AMnoPodspec
workaround in for the moment and make a Youtrack issue