Jayden King
05/10/2024, 9:32 AMJayden King
05/10/2024, 9:32 AM> Task :shared:linkPodDebugFrameworkIosArm64 FAILED
warning: Cannot infer a bundle ID from packages of source files and exported dependencies, use the bundle name instead: shared. Please specify the bundle ID explicitly using the -Xbinary=bundleId=<id> compiler flag.
error: /Users/jaydenking/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory:
kotlin.native.cacheKind.iosArm64=none
Also, consider filing an issue with full Gradle log here: <https://kotl.in/issue>
The /Users/jaydenking/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: warning: ignoring duplicate libraries: '-ldl'
ld: warning: object file (/Users/jaydenking/StudioProjects/The-Carbon-Conscious-Traveller/shared/build/cocoapods/synthetic/ios/build/Release-iphoneos/XCFrameworkIntermediates/GoogleMaps/Maps/GoogleMaps.framework/GoogleMaps) was built for newer 'iOS' version (14.0) than being linked (12.0)
ld: Undefined symbols:
_GMSAreEqualOrBothNil, referenced from:
followed by a bunch of lines about _GMS*
Jayden King
05/10/2024, 9:34 AMplugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.sqldelight)
alias(libs.plugins.native.cocoapods)
alias(libs.plugins.jetbrains.compose)
}
kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = libs.versions.kotlinJvmTarget.get()
}
}
}
listOf(iosX64(), iosArm64(), iosSimulatorArm64()).forEach {
it.binaries.framework {
baseName = "shared"
binaryOption("bundleId", "com.mquniversity.tcct.iosApp")
}
}
sourceSets {
all {
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
commonMain.dependencies {
// implementation(libs.runtime)
// implementation(libs.primitive.adapters)
implementation(libs.koin.core)
implementation(libs.kotlinx.datetime)
// implementation(libs.coroutines.extensions)
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.ui)
implementation(compose.material)
implementation(compose.components.resources)
api(libs.kmm.viewmodel.core)
}
androidMain.dependencies {
implementation(libs.android.driver)
implementation(libs.koin.androidx.compose)
// implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.play.services.maps)
// implementation(libs.google.maps.services)
implementation(libs.play.services.location)
}
iosMain.dependencies {
implementation(libs.native.driver)
}
}
cocoapods {
// version = "1.0"
summary = "The Carbon-Conscious Traveller"
// source = "<https://github.com/CocoaPods/Specs.git>"
homepage = "<https://github.com/JaydenKing32/The-Carbon-Conscious-Traveller>"
license = "MIT"
ios.deploymentTarget = "15.0"
podfile = project.file("../iosApp/Podfile")
pod("GoogleMaps") {
version = libs.versions.podsGoogleMaps.get()
extraOpts += listOf("-compiler-option", "-fmodules")
}
framework {
baseName = "shared"
isStatic = false
}
}
}
android {
namespace = "com.mquniversity.tcct.shared"
compileSdk = libs.versions.androidCompileSdk.get().toInt()
defaultConfig {
minSdk = libs.versions.androidMinSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.kotlinCompilerExtension.get()
}
}
sqldelight {
databases {
create("AppDatabase") {
packageName.set("com.mquniversity.tcct.shared.cache")
}
}
}
Jayden King
05/10/2024, 9:36 AMtarget 'iosApp' do
use_frameworks!
platform :ios, '15.0'
pod 'shared', :path => '../shared'
pod 'GoogleMaps', '8.4.0'
end
Jiri Bruchanov
05/12/2024, 8:13 AMbinaryOption("bundleVersion", "2")
isStatic = true
but not sure if it's going to helpJiri Bruchanov
05/12/2024, 8:14 AMCannot infer a bundle ID from packages of source files and exported dependencies
looks like your project setup has some issue...
be also sure you have everything updated to latest stable versions... it might be very well some older bugJayden King
05/12/2024, 8:17 AMisStatic = true
since I'm using SQLDelight and it's apparently incompatible with that. Which versions are you referring to exactly? I know that I need to keep some things at a lower version with KMM like AGPJiri Bruchanov
05/12/2024, 8:27 AMkotlin = "1.9.23"
jvmtarget = "17"
sqldelight = "2.0.2"
jetbrains-compose-ui = "1.6.2"
I have sqldelight part of my project as well, and I do have it static... not sure why would sqldelight need isStatic = false
but I'm not super experienced in KMP/iOS build pipeline...
anyway in these cases,
I usually go with try&error approach from very basic project template, there was always some stupid mistake I had in my project setup...Jayden King
05/12/2024, 8:30 AMJayden King
05/13/2024, 4:40 AMisStatic = true
I get this error instead:
ld: warning: ignoring duplicate libraries: '-ldl'
ld: framework 'GoogleMaps' not found
Jayden King
05/13/2024, 12:10 PMisStatic = true
in both the binaries.framework block and the cocoapod's framework block in order to build with the GoogleMaps pod