icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
1.02k stars 95 forks source link

IOS - Alamofireimage build Error, probably wrong mpp config. #75

Closed rhonyabdullah closed 3 years ago

rhonyabdullah commented 3 years ago

I try to using moko-mvvm and Mobule Multiplatform gradle plugin, but my ios project still remains error, did i missing another config ? I also done setting up pod config which require MultiPlatformLibrary on my /ios/PodFile

Before alamofire error i'm also facing livedata error not found, but after adding alamofire dependency to podFile it leading to alamofire error like i said above.

Please check my public repository since i'm using it for learning purposes. Also i hope somebody make a pull request so i can read and learn whats wrong on my configuration.

Alex009 commented 3 years ago

hello! what problems was:

  1. while moko-mvvm, moko-resources not builded with kotlin 1.4.10+ transitive dependencies of iosMetadata nor work, so we should add dependencies manual - https://github.com/icerockdev/moko-mvvm/issues/63#issuecomment-698342092
  2. you have duplicated android package usage (android-app and shared library have same packageId) - it cause of dex conflict error
  3. in MultiPlatformLibraryMvvm now not specified version of AlamofireImage (https://github.com/icerockdev/moko-mvvm/issues/74) and you download latest version, which not support required by MultiPlatformLibraryMvvm ios version. to fix it we should add correct version of AlamofireImage into Podfile
  4. you should export libs to ios framework to remove prefix of libraries from classes in swift - it required for compilation of MultiPlatformLibraryMvvm
  5. you have old configs of integration kotlin framework to ios without cocoapods - it conflicts with cocoapods and should be removed

i apply all fixes in https://github.com/rhonyabdullah/OWeatherKMM/pull/1 and you can compile both platforms ./gradlew assemble work correctly pod install too and run of ios app too

rhonyabdullah commented 3 years ago

Firstly, thanks for your clear explanations, So obviously the problem is not only coming from Alamofire versions, multiple wrong configuration with common bug inside. I'm working on this, if you have any idea about this issue title feel free to change it but please don't close this issue at this moment, will close it by my self.

rhonyabdullah commented 3 years ago

Resolved by this pull request.