Marcus
01/08/2021, 1:42 PMpod("AFNetworking")
to the cocoapods section in build.gradle.kts, I get
> Task :shared:cinteropAFNetworkingIosArm64 FAILED
Exception in thread "main" java.lang.Error: /var/folders/4g/3s9scp9d5593dphx7n_7nhk40000gn/T/tmp1272859169392324213.m:1:9: fatal error: module 'AFNetworking' not found
I'm trying this in an KMMApplication template from AndroidStudio 4.1.1 running Kotlin Plugin 1.4.21-release-Studio4.1.1, in which I've only modified build.gradle.kts to add
kotlin("native.cocoapods")
to the plugins, changed the
ios {
…
}
block to
ios()
to get rid of the
Caused by: java.lang.IllegalArgumentException: Cannot create binary debugFramework: binary with such a name already exists
error that appears when adding the Cocoapods plugin and added this
cocoapods {
pod("AFNetworking")
}
section. Am I missing something?kpgalligan
01/08/2021, 2:48 PMmodule 'AFNetworking' not found
. It's configured, but not finding that module for whatever reason. I'd also maybe try to build a regular iOS app in xcode with cocoapods to make sure that's working.kpgalligan
01/08/2021, 3:26 PMMarcus
01/08/2021, 3:33 PMpod("AFNetworking", "~> 4.0")
as the dependency. That didn't change anything for me. At the same time, if I'm adding the same dependancy to a regular iOS app, it is indeed working correctly.kpgalligan
01/08/2021, 3:33 PMJeff Lockhart
01/08/2021, 10:04 PMversion
, summary
and homepage
are required as well:
...
version = "1.0"
kotlin {
...
cocoapods {
summary = "Something"
homepage = "<http://example.com|example.com>"
pod("AFNetworking")
}
}
kpgalligan
01/08/2021, 10:42 PMJeff Lockhart
01/09/2021, 2:26 AMMarcus
01/09/2021, 11:59 AMfatih
01/10/2021, 9:28 PMiosMain
folder to target-specific source sets(iosX64Main
, iosArm64Main
, etc). Code comletion is missing in iosMain
but compilation should work fine. https://youtrack.jetbrains.com/issue/KT-42319#focus=Comments-27-4417756.0-0Marcus
01/11/2021, 9:30 AMiosMain
folder in my shared
Module to iosArm64Main
and created a symlink to that named iosX64Main
, so it now looks like attached. Unfortunately, that doesn't seem to help either.
I've tried to open the example project referenced in YouTrack, but that doesn't work for me (even after removing the outdated version numbers of the specified plugins, the whole kotlin() section in build.gradle.kts
remains red).chi
01/11/2021, 2:43 PMAFNetworking
works for me but I see this error when I try to use some other dependencies like (CouchbaseLite-Enterprise)
. I'm using AS Canary version, so in my root build.gradle I have;
classpath 'com.android.tools.build:gradle:7.0.0-alpha03'
// Touchlab build errors fails silently, making it hard to debug
//classpath 'co.touchlab:kotlinnativecocoapods:0.12'
In my shared module build.gradle.kts I have the following;
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.kotlin.native.cocoapods")
}
cocoapods {
summary = "..."
homepage = "..."
ios.deploymentTarget = "13.5"
pod("AFNetworking")
pod("Masonry")
}
My project setup is still the just
ProjectName
--app
--shared
--src
--androidMain
--iosMain
--commonMain
--ios
chi
01/11/2021, 2:46 PMpod("CouchbaseLite-Enterprise")
I get the a similar error like Exception in thread "main" java.lang.Error: /var/folders/4g/3s9scp9d5593dphx7n_7nhk40000gn/T/tmp1272859169392324213.m:1:9: fatal error: module 'CouchbaseLite-Enterpris not found
even though CouchbaseLite-Enterprise
is an Obj-C library. Been sadly stuck on this for daysJeff Lockhart
01/11/2021, 5:57 PMMarcus
01/11/2021, 7:00 PMMarcus
01/12/2021, 11:18 AMcocoapods-generate
installed (even though I was sure I did – famous last words).chi
01/12/2021, 4:36 PMpod(CouchbaseLite-Enterprise)
if it works? I'm also having a similar error but not with AFNetworking
Jeff Lockhart
01/12/2021, 5:20 PMMarcus
01/13/2021, 9:46 AMCocoaPods could not find compatible versions for pod
during Gradle sync. In a normal Xcode project, I can include it just fine. Did you have the same issue?chi
01/14/2021, 10:42 AM/var/folders/pv/3_5xn0dd0v5bf6sxbfcsq_wr0000gn/T/7009311365357251921.m:1:22: error: expected ';' after module name
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
...
Marcus
01/14/2021, 10:58 AMchi
01/14/2021, 11:16 AMMarcus
01/14/2021, 11:47 AMcocoapods()
section, I now also get the same issue that you are getting. There's no temp file at the location specified.chi
01/14/2021, 12:55 PM-
because almost all dependency named as such doesn't work. There was a commit that tried to resolve this but I don't think it did. This is a serious issue I hope the Kotlin native team looks intoMarcus
01/14/2021, 1:01 PMvendored_frameworks
. So if I try
pod("CouchbaseLite-Enterprise", moduleName = "CouchbaseLite")
it seems to proceed further with the compilation (but is hit with Exception in thread "main" java.lang.IllegalArgumentException: 'CBLQueryMeta' is going to be declared twice
). Maybe you can go somewhere from there?chi
01/14/2021, 2:28 PMCouchbaseLite
library, which is a different library from the enterprise, maybe this is just compiling that module which I assume is a dependency for CouchbaseLite-Enterprisee
I think its what happens because if I change the moduleName to something else it returns the original errorJeff Lockhart
01/14/2021, 5:17 PMJeff Lockhart
01/15/2021, 2:30 AMpod("CouchbaseLite-Enterprise", moduleName = "CouchbaseLite")
does work to add the enterprise version of CouchbaseLite after applying this workaround for the CBLQueryMeta
error. Thanks for your help identifying this @Marcus. Do you understand what moduleName
is doing under the hood that makes this work?Marcus
01/15/2021, 8:25 AMimport
the module in a native project when for whatever reason this is different from the name of the pod.Jeff Lockhart
01/16/2021, 12:28 AM