moko-widgets icon indicating copy to clipboard operation
moko-widgets copied to clipboard

Samples instruction

Open Gamadril opened this issue 5 years ago • 4 comments

Please provide a description how to build and test the samples.

Gamadril avatar Feb 14 '20 10:02 Gamadril

hi!

use:

  • git clone https://github.com/icerockdev/moko-widgets.git
  • open repo in Android Studio and after sync run sample app (on android).

run on iOS:

  • cd ios-app && pod install to install all pods dependencies
  • ./gradlew :sample:mpp-library:syncMultiPlatformLibraryDebugFrameworkIosX64 to compile MultiPlatformLibrary.framework
  • cd ios-app && pod install again to correctly integrate MultiPlatformLibrary.framework in project

is such a description sufficient?

Alex009 avatar Feb 14 '20 10:02 Alex009

Thanks, such a short description would be enough. In Adnroid Studio after the sync I get an error form Java Compiler "WARNING: Unsupported Kotlin plugin version.", but the app seems to build and run.

The info about iOS steps is very helpful, because when I tried it on my own I always got an import error for "MultiPlatformLibrary". Now it's clear why. However I still have issues with the ios build.

  1. After running pod install in ios-app folder CocoaPods complains about "InputMask"
Analyzing dependencies
Pre-downloading: `MultiPlatformLibraryMvvm` from `https://github.com/icerockdev/moko-mvvm.git`, tag `release/0.4.0-dev-2`
[!] CocoaPods could not find compatible versions for pod "InputMask":
  In snapshot (Podfile.lock):
    InputMask (= 5.0.0, ~> 5.0.0)

  In Podfile:
    moko-widgets-flat (from `../../`) was resolved to 0.1.0, which depends on
      InputMask (~> 5.0.0)

None of your spec sources contain a spec satisfying the dependencies: `InputMask (= 5.0.0, ~> 5.0.0), InputMask (~> 5.0.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

pod update before pod install solves this problem.

  1. ./gradlew :mpp-library: syncMultiPlatformLibraryDebugFrameworkIosX64 generates following output. The build fails.

> Configure project :gradle-plugin
WARNING: Unsupported Kotlin plugin version.
The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.3.31` that might work differently than in the requested version `1.3.61`.

> Configure project :widgets
Kotlin Multiplatform Projects are an experimental feature.

> Configure project :sample:mpp-library
CocoaPod mokoWidgetsFlat integrated only in link target iosArm64 (native) stage
CocoaPod mokoWidgetsFlat integrated only in link target iosX64 (native) stage

FAILURE: Build failed with an exception.

* What went wrong:
Project 'mpp-library' not found in root project 'moko-widgets'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s

Gamadril avatar Feb 14 '20 14:02 Gamadril

sorry, invalid command. should be: ./gradlew :sample:mpp-library:syncMultiPlatformLibraryDebugFrameworkIosX64 when you run from root repository dir

Alex009 avatar Feb 14 '20 15:02 Alex009

That looks better. I can build and run it on iOS, too.

Gamadril avatar Feb 14 '20 15:02 Gamadril