Giter Club home page Giter Club logo

Comments (10)

Vaibhav2002 avatar Vaibhav2002 commented on June 8, 2024 1

@ASalavei Here is the minimal reproducer https://github.com/Medial-Tech/Medial-App-Reproducer/tree/main
It builds fine on 1.5.11 but as soon as i upgrade to 1.6.2 it throws "Duplicate symbols" when built from Android Studio

from compose-multiplatform.

ASalavei avatar ASalavei commented on June 8, 2024

Hi!
We're using CMPUIKit static library in compose framework. You're importing 2 frameworks both have own copy of it.
I would recommend to use only one top-level dependency of Multiplatform framework. In your case if shared-ui-screens uses shared-ui as dependency, I would include only the first one into iOS App, and propagate symbols from dependent shared-ui.

Also, you can provide minimum viable repro application sample to let us make close look into it.

from compose-multiplatform.

Vaibhav2002 avatar Vaibhav2002 commented on June 8, 2024

Hi,
shared-ui module uses shared-ui-screens as an implementation dependency
Same, shared uses shared-ui as an implementation dependency

shared-ui

kotlin {
    
    sourceSets {
        commonMain.dependencies {
            implementation(project(":shared:core"))
            implementation(project(":shared:ui:core"))
            implementation(project(":shared:ui:components"))
            implementation(project(":shared:ui:screens"))
            implementation(project(":shared:domain"))

            implementation(libs.bundles.decompose)
            implementation(libs.moko.permissions)
        }
    }
}

shared

kotlin {

    cocoapods {
        podfile = project.file("../iosApp/Podfile")
    }

    sourceSets {
        commonMain.dependencies {
            implementation(project(":shared:core"))
            implementation(project(":shared:ui"))
            implementation(project(":shared:domain"))
            implementation(libs.decompose.core)
            implementation(libs.moko.permissions)
        }

        androidMain.dependencies {
            implementation(androidLibs.activity.compose)
        }
    }
}

from compose-multiplatform.

ASalavei avatar ASalavei commented on June 8, 2024

Could you please remove everything valuable from your project and upload minimal sources set that reproduces your issue on GitHub to do proper investigation?

from compose-multiplatform.

ASalavei avatar ASalavei commented on June 8, 2024

Thank you for the reproducer. I can see you're using 4 multiplatform frameworks added via CocoaPods to you iOS app.
It's recommended to create umbrella framework to solve this issue. Also you can use export dependencies to propagate symbols to your umbrella framework.
As a bonus, you will get reduced application size and faster launch time.

from compose-multiplatform.

Vaibhav2002 avatar Vaibhav2002 commented on June 8, 2024

Thank you for the reproducer. I can see you're using 4 multiplatform frameworks added via CocoaPods to you iOS app.
It's recommended to create umbrella framework to solve this issue. Also you can use export dependencies to propagate symbols to your umbrella framework.
As a bonus, you will get reduced application size and faster launch time.

The pod dependencies in all those child modules which are exported as a separate framework is not actually used in the iOS native side, but only within the shared module.

Do i still need to include those in the umbrella framework?
Do i also need to include all other child modules, even those which dont have any pod dependencies?

I only need the files from the parent "shared" module in iOSApp, none from the child modules. Thats why I have used implementation() everywhere instead of api()

As said here

I use pods like GoogleSignIn, Ably, Reachability, Amplitude which are only used in the shared module and not in Swift

from compose-multiplatform.

ASalavei avatar ASalavei commented on June 8, 2024

I only need the files from the parent "shared" module in iOSApp, none from the child modules. Thats why I have used implementation() everywhere instead of api()

Hmm.. your iOS app currently depends on 4 frameworks that was build from different modules. Do you really need these dependencies? If you can remove safely all except one, then the issue will be solved.

from compose-multiplatform.

Vaibhav2002 avatar Vaibhav2002 commented on June 8, 2024

I only need the files from the parent "shared" module in iOSApp, none from the child modules. Thats why I have used implementation() everywhere instead of api()

Hmm.. your iOS app currently depends on 4 frameworks that was build from different modules. Do you really need these dependencies? If you can remove safely all except one, then the issue will be solved.

I tried, but then I get Undefined Symbols issue
Mentioning some files of Ably, Reachability, Amplitude and other pods

If I mention those pods again in iosApp/PodFile it works, but I dont think this is right as I only use them in shared and are already defined in the child module its used in

Had to add the last 4 pods here to fix the Undefined Symbols issue, but I dont use them directly in Swift
Used only inside shared

target 'Medial' do
  use_frameworks!
  platform :ios, '14.1'

  pod 'shared', :path => '../shared'

  pod 'FirebaseMessaging'
  pod 'FirebaseAnalytics'
  pod 'FirebaseCrashlytics'
  pod 'Siren'
  pod 'BranchSDK'
  pod 'Ably'
  pod 'Reachability'
  pod 'GoogleSignIn'
  pod 'Amplitude', '8.17.1'
end

from compose-multiplatform.

ASalavei avatar ASalavei commented on June 8, 2024

It means your iOS app does not know where to find these frameworks. Something (Someone) should tell this info to iOS app via Build Settings > Framework Search Paths. Maybe it can be done using podespec of the shared framework - see script inside each file. Unfortunately I don't know how to do it exactly, but it definitely the way to go. Try to ask in our Slack channels: https://kotlinlang.slack.com/archives/C3PQML5NU https://kotlinlang.slack.com/archives/C0346LWVBJ4

Btw, the Podfile you shared looks OK until you are using dynamic frameworks (use_frameworks! option).

from compose-multiplatform.

Vaibhav2002 avatar Vaibhav2002 commented on June 8, 2024

Thanks for the help @ASalavei
I will check this out

from compose-multiplatform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.