https://kotlinlang.org logo
Title
d

darkmoon_uk

10/05/2020, 6:58 AM
Are there any idiocsyncracies to the cocoapods support - I've set it up as instructed but attempting to sync the project fails with <cocopod name> module not found... oddly all except one of the pods which does succeed.
a

Artyom Degtyarev [JB]

10/05/2020, 9:15 AM
Hello, there was a similar report recently, but I was unable to reproduce it. Could you please share problematic pods list?
d

darkmoon_uk

10/05/2020, 9:37 AM
My
cocoapods
section:
cocoapods {
        // Configure fields required by CocoaPods.
        summary = "Some description for a Kotlin/Native module"
        homepage = "Link to a Kotlin/Native module homepage"

        // You can change the name of the produced framework.
        // By default, it is the name of the Gradle project.
        frameworkName = "hydrant_art"
        ios.deploymentTarget = "14.0"

        pod("GoogleMaps")
        pod("Filament", "~> 1.9.2")
        pod("Firebase/Analytics")
        pod("Firebase/Firestore")
        pod("Firebase/Storage")
        pod("Firebase/Database")
        pod("Firebase/RemoteConfig")
    }
GoogleMaps
resolves OK, but none of the others do.
Checking both the Filament and Firebase instructions, neither talk about needing any special repo's. Also when I manually created a
Podspec
file and ran
pod install
it completed successfully.
It's just the Gradle sync that fails.
All the usual remedies don't change it: clearing caches, cleaning build, deleting cocapods cache 🤷
I also tried installing cocoapods via the
gem
and via
brew
.
These seem consistent; the build output has the detail on why
cinteropFilamentIos
fails, that is hidden behind the
java
invocation during sync.
fatal error: module 'Filament' not found
It's the same for the
Firebase/*
pods.
a

Artyom Degtyarev [JB]

10/05/2020, 12:22 PM
I remember something familiar about the
Firebase/
ones, there was a problem solvable with quite a different naming. I just tried locally, and getting rid of all those slashes made things work.
ios.deploymentTarget = "14.0"
        pod("GoogleMaps")
        //pod("Filament", "~> 1.9.2")
        pod("FirebaseAnalytics")
        pod("FirebaseFirestore")
        pod("FirebaseStorage")
        pod("FirebaseDatabase")
        pod("FirebaseRemoteConfig")
For the
Filament
, I found this thread, and everything looks really less promising. Maybe you could try pinging library maintainers somewhere like https://github.com/google/filament/issues/1197 or https://github.com/google/filament/issues/139, but at the moment this binding most probably just won’t work.
d

darkmoon_uk

10/05/2020, 12:29 PM
@Artyom Degtyarev [JB] Thanks very much for this information.
The removal of the slashes feels like a bug in the Cocoapods integration - would you agree? The advertised names of these pods include the slashes after all.
As for Filament, I'll also follow up in those threads already handling the issue.
Thanks again.
a

Artyom Degtyarev [JB]

10/05/2020, 12:40 PM
I totally agree. Those slashes issue us about subspecs, I’m not an expert but it is about some pods have two different versions - as a subspec and as a single pod. The second variant is what we used here now. Interestingly, I’ve just found this issue - https://youtrack.jetbrains.com/issue/KT-32750 stating the problem was fixed already. Better ask @Yaroslav Chernyshev [JB] to take a look here.
a

Aleksey Chugaev

10/08/2020, 11:36 AM
Hey @darkmoon_uk did you manage to resolve this issue? I'm having a similar problem,
pod install
works fine without any warnings but gradle sync fails with:
> Task :background-sdk:cinteropLocalzDriverSDKIos FAILED
Exception in thread "main" java.lang.Error: /var/folders/y1/f44ld52d3sl2scm9p_mdwkbc0000gn/T/tmp2184417698632498043.m:1:9: fatal error: module 'LocalzDriverSDK' not found
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:67)
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:13)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:430)
In my Podfile I have
source '<https://github.com/localz/Spotz-iOS-Specs.git>'
...
use_frameworks!
...
pod 'LocalzDriverSDK', '1.7.2'
however, when I change it to (I have access to SDK source)
pod 'LocalzDriverSDK', :path => '../../ios/localz-driver-sdk-ios'
it all works fine
y

Yaroslav Chernyshev [JB]

10/08/2020, 11:40 AM
@Aleksey Chugaev Custom spec repos are supported in 1.4.20-M1. Please try to add
specRepos {
    url("<https://github.com/localz/Spotz-iOS-Specs.git>")
}
into
cocoapods
block where
pod("LocalzDriverSDK")
declared
a

Aleksey Chugaev

10/08/2020, 11:41 AM
thanks, will give it a try