icerockdev / moko-template

Template project of a Mobile (Android & iOS) Kotlin MultiPlatform project with the MOKO libraries and modularized architecture
https://moko.icerock.dev/
Apache License 2.0
460 stars 47 forks source link

Unable to run ios app #4

Closed michaelbrainvu closed 4 years ago

michaelbrainvu commented 4 years ago

When trying to run the app on xcode 11.3.1 build failed due to: no such module "MultiPlatformLibraryUnits". The pod framework seems to be generated properly but the version of MultiPlatformLibraryUnits is not up to date and also the podspec files do not specify the correct library versions for Units and Mvvm. Updating the moko-unit release label in Podfile does not solve the issue

Alex009 commented 4 years ago

hello! Have you completed the actions from README?

iOS - run pod install in directory ios-app. Then open ios-app/ios-app.xcworkspace and press Run on simulator/device.

maybe you open ios-app/ios-app.xcodeproj instead of ios-app/ios-app.xcworkspace ?

michaelbrainvu commented 4 years ago

My bad :(, I opened the xcodeproj. But still the build failed for unknown reason while building the MultiPlatformLibrary, Alamofire and SkyFloatingLabelTextField. On the build log of MultiPlatformLibrary I see the lines:

Showing All Messages

Not sure how :android-app is involved here

michaelbrainvu commented 4 years ago

Not sure how it happened but I managed to make the iOS app work on a separate project. Also managed to upgrade to moko-units 0.2.2 which I recommend to do on the template.

Alex009 commented 4 years ago

yes, moko-units and other moko libs will be updated later in template.

can you add in this line: https://github.com/icerockdev/moko-template/blob/fb59761a17f339de99244f1a6f5a02edf1210129/mpp-library/MultiPlatformLibrary.podspec#L33 --stacktrace and run build again? it will show stacktrace of exception in log.

also maybe you not open project in Android Studio and not have local.properties file, which created by Android Studio automatically.

content of file should be:

sdk.dir=<path to android sdk>

android sdk required when gradle multiplatform project contains android target