Skip to content

Demo run

xuwhale6 edited this page Jan 19, 2020 · 1 revision

Demo run

一、Download project

  1. git clone

    git clone https://github.com/momotech/MLN
    
  2. Directory structure introduction

    No. directory Function description
    1. Android Studio Templates AS template(Several types of bridges)
    2. MLN-Android Android sdk source code + demo project(Meilishuo demo, other demos)
    3. MLN-iOS iOS sdk source code + demo project(Meilishuo demo, other demos)

二、Run project engineering

  1. Run Android Project
    1)Open the MLN-Android directory with Android Studio;
    2)Run the installation to the mobile phone, and the running result is shown in the figure below;


    3)Click the "Hot Reload" button to enter the hot reload interface and debug lua Bridge. For the next steps, please refer to MLN development environment
    4)Click the "Example" button, and we will show some demos we wrote using Bridge;
    5)Click "Demo Project", this Demo is the "beautiful say" interface we wrote with the bridge Bridge, the effect is shown below:


    ⚠️Problems that may be encountered during compilation:
    1)If you encounter an error: Error: No such property: GradleVersion for class: JetGradlePlugin, please upgrade Android Studio to version 3.5.
    2)If you encounter gradle incompatibility issues on Android Studio 3.5, please use the recommended version of gradle 5.1.1 in the project, and use the 3.4.0 version of the gradle plugin, and then click Sync Project With Gradle Files in the toolbar.

    The Lua code storage path of the "Example" and "Demo Project" in the Android project is shown below:

  2. Run iOS project
    1)Use Xcode to open MLN-iOS-> Example-> MLN.xcworkspace;
    2)Open the terminal located in the Example folder and perform the pod initialization operation (⚠️CocoaPods version needs to be 1.6.0 and above);

    $ pod install
    

    3)Click Run and install it on the phone. The running effect is the same as the above Android running result. The next steps on the mobile phone are the same as the above Android operating steps.

    The lua code storage path of the "example" and "demo project" in the iOS project is shown below:

Clone this wiki locally