https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
multiplatform
  • j

    jeran

    02/04/2021, 8:32 PM
    hi all. so i've created a standard multiplatform project using the KMM plugin. then i've created a sibling KMM module that I want my apps to depend on. so i've updated the shared module to depend on it as such (I've left the default name for this example):
    val commonMain by getting {
        dependencies {
            api(project(":kmmsharedmodule"))
        }
    }
    And now my shared module can use all the code it wants from the kmmsharedmodule. great. Also you'll note I've used
    api
    instead of
    implementation
    , which means my Android app also has access to the kmmsharedmodule code. BUT, the kmmsharedmodule's api is not being exposed to the iOS app via the framework. from the iOS app I can only get access to the kmmsharedmodule if I use something from it in the public api of the shared module. for example if I had in the shared module something like:
    fun doSomething(): SomeKmmSharedModuleClass {}
    Then the SomeKmmSharedModuleClass would be accessible from the iOS app. Anyone have any idea how to fix this?
    ✅ 1
    k
    • 2
    • 2
  • k

    Kris Wong

    02/04/2021, 8:46 PM
    don't suppose anyone has explored integration with Sonar for code coverage? most of what I am seeing on the interwebz doesn't look promising.
    i
    • 2
    • 5
  • j

    Javier

    02/04/2021, 11:30 PM
    I am getting this error. With IntelliJ IDEA 2021.1 EAP
    Duplicate content roots detected: Path [.../lib] of module [....lib] was removed from modules [....lib]
    m
    • 2
    • 3
  • m

    Marc Dietrichstein

    02/05/2021, 7:57 AM
    Hi all, This is related to the JS code generated in my multiplatform project. The ktor client gives me
    undefined is not an object (evaluating 't.length')
    errors when I try to fetch data from a REST endpoint. The problem seems to be related to the buffer module that ktor uses (https://github.com/feross/buffer). It only occurs when using the legacy js backend. Kotlin: 1.4.21 Ktor: 1.5.1 Is anyone familiar with this issue?
    t
    • 2
    • 7
  • a

    Andy Victors

    02/05/2021, 10:46 AM
    What is the proper way of using generated from MPP library .jar in Android Studio? I have created a minimal library to test, with JVM target. Then I try to manually included generated .jar into Android Studio project but classes cannot be found (Invalidate caches already tried:/)
    • 1
    • 2
  • g

    Goku

    02/05/2021, 10:54 AM
    Hey guys, I’ve just started with KMM and I have a minor, but annoying issue with CocoaPods integration. Essentially, I’ve added this to my shared
    build.gradle.kts
    file:
    version = "1.0-SNAPSHOT"
    
    kotlin {
    
        android()
        ios()
    
        cocoapods {
            frameworkName = "shared"
    
            ios.deploymentTarget = "13.0"
    
            summary = "CocoaPods Test Library"
            homepage = "<https://github.com/JetBrains/kotlin>"
    
            pod("AFNetworking") {
                version = "~> 4.0.1"
            }
    
            pod("PromisesSwift") {
                moduleName = "Promises"
            }
        }
    ...
    And the project builds, the pods are available in both Kotlin code and Swift (I’ve included a path to podspec file) but the module (AFNetworking in this case) isn’t seen, yet it works.
    k
    k
    • 3
    • 4
  • j

    Jeff Lockhart

    02/05/2021, 10:12 PM
    Is anyone using cocoapods dependencies in tests? I've asked about a linker error with this, but haven't received any answers. Is anyone doing this successfully?
    t
    k
    b
    • 4
    • 22
  • m

    Michal Janos

    02/05/2021, 11:18 PM
    Hi I have problem with multiplatform for JS NPM Kotlin Code:
    internal fun preparePartiesDataCalculation(
        partiesCalculationEntryData: List<PartyCalculationEntryData>,
        product: Product,
        ridersMap: Map<String, RiderParametersAndCore>
    ): List<PartyPreparedForCalculation> {
    
        return partiesCalculationEntryData.map { party ->
            val professionsWithInternalParameters = party.professions.map {
                MaxProfessionRiskGroupParameters(parameters = getInternalProfessionParams(it.parameters))
            }
    Generates problem in JS use Where partiesCalculationEntryData is as JS array
    • 1
    • 1
  • w

    william

    02/05/2021, 11:42 PM
    is there anything like the android
    @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
    available on multiplatform?
    r
    • 2
    • 1
  • a

    Allen Eubank

    02/06/2021, 12:04 AM
    Has anyone gotten gradle composite builds to work with KMP?
    a
    • 2
    • 1
  • f

    fkrauthan

    02/06/2021, 4:49 AM
    Hey my Intellij in latest version shows me the error message:
    The feature "multi platform projects" is experimental and should be enabled explicitly
    for a shared lib. But I do have in my gradle file this
    targets.all {
            compilations.all {
                kotlinOptions {
                    freeCompilerArgs = listOf("-Xmulti-platform")
                }
            }
        }
    but the error does not go away. It is running fine but super annoying. Anyone know what todo?
    j
    h
    i
    • 4
    • 18
  • a

    Ali Albaali

    02/07/2021, 6:51 PM
    I have a multiplatform project and it contains 3 modules desktop(jvm), commonJvm and android. When I try to run
    PublishKotlinMultiplatform
    task, I get this error:
    Execution failed for task ':kamel-core:generateMetadataFileForKotlinMultiplatformPublication'.
    > Invalid publication 'kotlinMultiplatform':
    - Variants 'commonJvmApiElements-published' and 'desktopApiElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
    - Variants 'commonJvmRuntimeElements-published' and 'desktopRuntimeElements-published' have the same attributes and capabilities. Please make sure either attributes or capabilities are different.
    Anyone has an idea how to fix it?
    k
    • 2
    • 12
  • p

    Piotr Krzemiński

    02/07/2021, 7:25 PM
    Hi, I came up with an idea for an RPC library tailored to Kotlin Multiplatform. I described it on the forum and wondering what are your thoughts: https://discuss.kotlinlang.org/t/feedback-request-kotlin-rpc-a-kotlin-centric-multiplatform-rpc-library/20787/2
    r
    • 2
    • 2
  • y

    Yaniv Sosnovsky

    02/08/2021, 2:03 PM
    Hi guys. I’m trying to build a framework for iOS using cocoapods plugin for KMM. When the process is finished, the binary file is marked as a ‘document’ file instead of ‘unix executable’. This doesn’t seem to be a problem when running the hosting application with XCode, but it gets rejected by Apple with this message: “ERROR ITMS-90171: “Invalid Bundle Structure - The binary file ‘…/MyFile’ is not permitted”. I believe we get the message because of the incorrect document type. We know we can ‘force’ the file to be marked as ‘unix executable’ by running ‘chmod 755 ’ on the file name, but this feels like a terrible solution (if one can call it a ‘solution’ at all). Any ideas would be welcomed!
    👀 1
    ➕ 1
    a
    a
    • 3
    • 10
  • a

    Amritansh

    02/08/2021, 10:15 PM
    Posting this here as well since I am not sure which one is the perfect channel for this issue
    b
    • 2
    • 1
  • e

    Evan

    02/09/2021, 12:56 AM
    Can anyone point me to any resources about getting code coverage to work in a KMM SDK project? I used the IDE wizard to create the standard starter project with the Greeting/Platform classes. Running the default tests w/o coverage, they all pass. When I run the default test to check if Android is mentioned with coverage, it shows 0%. I tried switching the test coverage runner to jacoco and it fails with the following:
    * Where:
    Initialization script '/private/var/folders/x6/7s_3dlx95fj03stb89dd02_40000gn/T/ijresolvers6.gradle' line: 152
    * What went wrong:
    Execution failed for task ':shared:testDebugUnitTest'.
    > Could not get unknown property 'AndroidGreetingTest_testExample' for build 'MyApplication' of type org.gradle.invocation.DefaultGradle.
    a
    • 2
    • 1
  • t

    Thomas Flad

    02/09/2021, 12:22 PM
    message has been deleted
    l
    c
    j
    • 4
    • 5
  • i

    ivano

    02/09/2021, 1:53 PM
    • Prefer coroutines to RXJava • Have a clean architecture  with MVVM with view and even viewModels small as possible( you could use MOKO in the future) • Use Compose • Map models with Kotlin Serialization because Moshi is not sure will be implemented • try to put generics as extension functions because is not sure will be implemented soon • for new projects implement Ktor for simple rest api • Be aware that your repository could be shared with iOS
    m
    t
    +2
    • 5
    • 7
  • s

    Shabinder Singh

    02/09/2021, 2:26 PM
    Any Idea why is it saying no static method exists??
    m
    r
    • 3
    • 11
  • n

    Not Me

    02/09/2021, 2:49 PM
    A quick question about a full-stack dev in IDEA: I created a multiplatform “Full-Stack Web Application” in IDEA - now I’m wondering what the quickest path to a sane development experience is? Surely a full “production” rebuild for every change isn’t the way to go?
    m
    o
    • 3
    • 5
  • j

    Jack Darlington

    02/09/2021, 4:22 PM
    Hi everyone, does anyone know of away to exclude a platform from cocoapods. E.g. download framework for ios and not for macos?
    a
    • 2
    • 10
  • g

    gammax

    02/09/2021, 7:35 PM
    Hey all 👋 We (#detekt) are in the process of adding support for Kotlin Multiplatform projects 🎉 I’m writing as: • I’m looking for someone to help us with a Gradle question. Specifically I’m unsure why the Gradle KMM plugin is creating a
    metadata
    target with several compilations (e.g. both
    main
    and
    commonMain
    ). More details are in this Github PR. • I’m looking for someone that would be interested in trying Detekt in a KMM project in some form.
    👋 1
    :kotlin-intensifies: 14
    j
    n
    c
    • 4
    • 6
  • j

    Jeff Tycz

    02/10/2021, 12:36 AM
    When I build and publish my multiplatform library to my maven repo the artifact name that gets created is the name of the module in the project example:
    com.tycz:library-android:0.2.0
    Where
    library
    is the module name in the project I want to change it to something like this
    com.tycz:myProject-android:0.2.0
    How can I change the artifact name?
    m
    j
    • 3
    • 6
  • i

    Ilya Varnakin

    02/10/2021, 9:35 AM
    I've got a problem with Base64 encoding in kmm. There are solutions, but they are platform-specific and vanilla kotlin solution (.encodeBase64) annotated as @InternalApi. Has anyone met with such a problem? I mean is there out-of-the-box solution?
    a
    • 2
    • 2
  • j

    Joost Klitsie

    02/10/2021, 1:50 PM
    Hi all! I have a KMP with a react website and an Android application. To support the functional components, I make my props (RProps) external interfaces in the common module. However, when I try to build the Android application, it complains about these external interfaces:
    Modifier 'external' is not applicable to 'class'
    It looks (for example) like this:
    external interface EventDetailsContractProps: BaseProps {
        var eventId: UUID
        var handler: EventDetailsContract.Handler
    }
    
    interface EventDetailsContract {
        interface Handler: EventSummaryContract.Handler {
            fun onEventDetailsFinished()
        }
    }
    
    data class EventDetailsProps constructor(
        override var eventId: UUID,
        override var handler: EventDetailsContract.Handler
    ): EventDetailsContractProps
    This code is shared between my javascript and android targets. Is there any way to resolve this? I could try:
    expect interface EventDetailsContractProps {
        var eventId: UUID
        var handler: EventDetailsContract.Handler
    }
    And then make a platform specific
    actual
    Interface, but that would mean a lot of boilerplate (As I would have to rewrite the interface 3 times).
    m
    • 2
    • 6
  • j

    Javier

    02/10/2021, 1:52 PM
    Is there any alternative to JaCoCo which supports Multiplatform?
    ➕ 2
    k
    t
    +3
    • 6
    • 5
  • j

    Jawid

    02/10/2021, 3:43 PM
    Hello everyone, I am creating an Android application using KMM and want to upload an image using Ktor. But I couldn't find proper documentation or a sample code for the same. Can anyone share with me a code snippet or a sample repo, please? Thanks in advance.
    k
    • 2
    • 1
  • k

    Kunal Dabir

    02/10/2021, 4:11 PM
    Anyone from JetBrains working on Mutation Testing tool for Kotlin based on IR instead of JVM ByteCode? Which is the right forum to discuss this in more details?
    b
    • 2
    • 2
  • d

    dave08

    02/10/2021, 7:58 PM
    How are platform specific annotations handled in common code? Say, in js I need to use kotlin serialization, whereas on the server, Micronaut uses Jackson...?
    b
    • 2
    • 4
  • r

    rocketraman

    02/11/2021, 3:28 AM
    Trying to include FirebaseAuth as a cocoapods dependency on my shared lib:
    cocoapods {
        summary = "x"
        homepage = "x"
        frameworkName = "shared"
        ios.deploymentTarget = "13.0"
        pod("FirebaseAuth", "~> 7.6.0")
      }
    but the build fails at
    linkDebugFrameworkIosX64
    with:
    error: Linking globals named 'cocoapods_FirebaseAuth_FIRAuthErrorDomain_getter_wrapper0': symbol multiply defined!
    This was working fine with an older version of FirebaseAuth.
    c
    • 2
    • 26
Powered by Linen
Title
r

rocketraman

02/11/2021, 3:28 AM
Trying to include FirebaseAuth as a cocoapods dependency on my shared lib:
cocoapods {
    summary = "x"
    homepage = "x"
    frameworkName = "shared"
    ios.deploymentTarget = "13.0"
    pod("FirebaseAuth", "~> 7.6.0")
  }
but the build fails at
linkDebugFrameworkIosX64
with:
error: Linking globals named 'cocoapods_FirebaseAuth_FIRAuthErrorDomain_getter_wrapper0': symbol multiply defined!
This was working fine with an older version of FirebaseAuth.
I think it's because I use GitLive Firebase Kotlin SDK in my project, and it references FirebaseAuth 7.3.0. I was also referencing FirebaseAuth in my
cocoapods
section (as I have some platform-specific code in iosMain in my shared lib), and there was a symbol conflict of some type. May also be related to how Firebase is linked: https://github.com/firebase/firebase-ios-sdk/blob/master/docs/firebase_in_libraries.md. Removing
FirebaseAuth
from my cocoapods definition has solved the problem.
c

clark

06/30/2022, 2:31 PM
I know it has been a while since you experienced this issue, but I'm seeing basically the same error now myself. My
Podfile
in my
ios
directory does not specify any pod dependencies. In my shared
build.gradle.kts
I specify
pod("FirebaseAuth", "~> 8.14.0")
because it seems that that is the version being used by GitLive Firebase Kotlin SDK in v1.6.10 (link for reference). When I don't include that pod in my build.gradle file, and I try to build for iOS, I get:
ld: framework not found FirebaseAuth
When I do include it and try to build for iOS, I get:
e: Compilation failed: Linking globals named 'kniprot_cocoapods_FirebaseAuth0': symbol multiply defined!
Any further guidance on how you solved this issue would be greatly appreciated!
r

rocketraman

06/30/2022, 2:35 PM
Somehow our build works, even though I don't think it should be! This is the comment I have in our
cocoapods
section in our shared `build.gradle.kts`:
// We don't reference FirebaseAuth here, because firebase-kotlin-sdk references and there appears to be some
    // strangeness happening at link time when adding the dependency here also:
    // error: Linking globals named 'cocoapods_FirebaseAuth_FIRAuthErrorDomain_getter_wrapper0': symbol multiply defined!
    // -- the build appears to work fine without this here, though I'm not exactly sure why as we have code that
    // references it.
    // see also: <https://github.com/GitLiveApp/firebase-kotlin-sdk/issues/111>
    //pod("FirebaseAuth", "~> 8.11.0")
Check your ios Podfile and import Firebase/Auth there e.g.
pod 'Firebase/Auth', '~> 8.11.0'
c

clark

06/30/2022, 2:45 PM
No luck moving it to the
Podfile
This is my current cocoapods configuration in
build.gradle.kts
. I have tried every combination of having both of the commented out lines being enabled or not and nothing working quite yet.
cocoapods {
        summary = "*"
        homepage = "*"
        framework {
            isStatic = false // for SwiftUI preview
        }
        //  pod("FirebaseAuth", "~> 8.14.0")
        ios.deploymentTarget = "13.5"
        //  podfile = project.file("../ios/Podfile")
    }
Using kotlin version
1.7.0
Is there a reason you use version
8.11.0
instead of
8.14.0
?
r

rocketraman

06/30/2022, 2:46 PM
Just haven't updated in a while
👍 1
As a point of comparison, I don't have
isStatic = false
. In your podfile do you have
use_frameworks!
?
c

clark

06/30/2022, 2:50 PM
Good to note. I do have
use_frameworks!
in my Podfile.
r

rocketraman

06/30/2022, 2:50 PM
Do you have a reference to
dev.gitlive:firebase-auth
in your
commonMain
source set?
c

clark

06/30/2022, 2:54 PM
val commonMain by getting {
  .
  .
  .
  // Firebase KMP (3rd party OSS)
  implementation("dev.gitlive:firebase-auth:1.6.1")
}
r

rocketraman

06/30/2022, 2:57 PM
Looks pretty much the same though we're still on
1.4.3
.
c

clark

06/30/2022, 2:58 PM
Did you add the carthage related code to your build.gradle file from firebase-kotlin-sdk issue #111?
r

rocketraman

06/30/2022, 2:59 PM
No, don't use carthage
I'm assuming you tried the usual stuff with resetting cocoapods? Something like:
rm -rf ~/Library/Developer/Xcode/DerivedData/
rm -rf ~/Library/Caches/CocoaPods/
cd iosApp
pod deintegrate
rm -rf iosApp.xcworkspace/
pod update
c

clark

06/30/2022, 3:01 PM
I've only been doing the
pod deintegrate
step and cleaning gradle builds
I'll try those out
One other thing is we never use FirebaseAuth directly in iOS. Not sure if that would make a difference
Also, do you test by building your app or running the
packForXcode
gradle task?
r

rocketraman

06/30/2022, 3:02 PM
No, don't need
packForXcode
if you use cocoapods
c

clark

06/30/2022, 3:03 PM
We don't have our project set up as cocoapods dependency for iOS. But maybe that is the issue.
r

rocketraman

06/30/2022, 3:06 PM
Definitely. Do something like this in
cocoapods
in build.gradle.kts:
cocoapods {
  framework {
    baseName = "shared"
  }
}
and then in `Podfile`:
target 'iosApp' do
  pod 'shared', :path => '../shared'
  ...
end
c

clark

06/30/2022, 3:12 PM
Giving this a try now. Will update when I have results.
So I have my shared code imported as a Cocoapod now
If I don't include the `pod("Firebase/Auth", "~> 8.14.0") in my shared
build.gradle.kts
then I get the
ld: framework not found FirebaseAuth
But if I do include it, then I start getting some other weird error:
Exception in thread "main" java.lang.Error: /var/folders/sy/kt1x1x3s7tnc93dj8b1bzbdc0000gn/T/6822736881599445461.m:1:9: fatal error: module 'Firebase' not found
✅ RESOLVED: I ended up just being able to use Swift Package Manager to import the firebase-ios-sdk packages and by setting the binaries frameworks to be statically linked, it all worked! I found the answer in issue #288 for the firebase-kotlin-sdk-repo.
👍 1
View count: 24