As Weex cross-platform technology continues to be popular, a large number of weeX-based open source solutions have emerged. Weex Eros is such an open source APP solution for front-end Vue. Currently, the Weex framework can be used to develop applications, such as initial startup environment problems, project engineering problems, version upgrade and version compatibility problems, and incremental update problems. However, Weex Eros and other open source solutions can effectively solve these problems. Weex Eros is positioned not as a component library, but as an open source solution for front-end Vue based on Weex packaging. It is concerned with the entire APP project. With the strong support of Weex, the app can be compiled with a Vue code on both sides of iOS and Android. The app also has the capability of hot update through the internal hot update logic of Weex Eros and open source server logic.

Weex-eros is a solution to WEEX that uses vUE syntax sugar and is easy for front-end developers to get started with.

  • weex:weex.apache.org/zh/
  • Weex – eros: bmfe. Making. IO/eros – docs / #…
  • Share: an introductory article zhuanlan.zhihu.com/p/51302413

Because the Weex-Eros android terminal has not been updated for a long time, there are always some problems in the development process of the Android terminal. We need to change the SDK source code, and may need to supplement the native knowledge or customize the development.

EROS 2018.10.11 update to EROS 2018.10.11Weex-eros development notes

1. Screen rotation problem

The android/WeexFrameworkWrapper/app/SRC/main/AndroidManifest. XML this file, control screen rotation, you need to add:

android:screenOrientation="user"
android:configChanges="orientation|keyboardHidden|screenSize"
Copy the code
  • ScreenOrientation: indicates the user’s current preferred orientation. If the value is ‘sensor’, the screen rotation will rotate when turned off and will be toggled according to the gravity sensor.
  • ConfigChanges configChanges is used to configure vertical and horizontal slice switching. When configChanges is configured to the above configuration, the various life cycles are not re-called during screen switching, only the onConfigurationChanged method is executed, and the data in the Activity is not destroyed.

2. The keyboard blocks the input box

To prevent the keyboard from blocking the input field and automatically displaying the page, add the following configuration:

android:windowSoftInputMode="adjustPan"
Copy the code

For details, please refer to the following figure:

Blog.csdn.net/u010005281/…

3. Click the background of the dialog box or press the back button and the dialog box disappears

Use Android Studio to open the Android source code for Weex-Eros, and then search the SDK source file for modalManager. Java. The corresponding attribute is setCancelabel(Calcel).

www.cnblogs.com/howlaa/p/41…

WEEX Picker module if there are many options, there will be multiple default options. You need to replace the SDK source code of the Picker module with the latest source code on the official Github source address.

4, iOS screen rotation

EROS itself does not support Landscape development. For Landscape development, you can check Landscape Left and Landscape Right, as shown in the figure below.

www.jianshu.com/p/e0e6b5493…

5. Change the package name

Change the name of the native Android project package

The native Android project needs to change the package name of the native Android project. For the Weex-Eros project, just change the APPLICATION_ID of Android gradle.properties.

Example Change the name of the native iOS engineering package

The native iOS package name is easier to change, as shown below:

# eros platforms/android/WeexFrameworkWrapper/app/src/main/assets/bundle.zip platforms/android/WeexFrameworkWrapper/app/src/main/assets/bundle.config platforms/ios/WeexEros/WeexEros/bundle.zip platforms/ios/WeexEros/WeexEros/bundle.config ! .gitkeep ip.txtCopy the code

Then respectively into the platforms/WeexFrameworkWrapper/nexus, platforms/WeexFrameworkWrapper/wxframework folder perform rm – rf. Git clean up originally git information, After that, you can commit the Android source code to git repository, and then you don’t need to install Android dependencies anymore.

6, CocoaPods multiple version switching problems

EROS recommends 1.4.0 because the current WXDevtool plugin (1.5.3) is based on 1.4.0. Personally, I only find problems with this plugin. You can use the following version to view the native CocoaPods version.

gem list --local | grep cocoapods
Copy the code

pod --version
Copy the code

How do you manage CocoaPods if there are multiple versions of CocoaPods involved? At this point, you’ll need to install a Bundler management tool.

gem install bundler
Copy the code

Method of use

1. Go to the Podfile directory and run the following command to create a Bundler configuration file, Gemfile.

bundle init
Copy the code

2. Modify the Gemfile file as follows. The version number can be modified according to your own requirements.

bundle exec pod update
Copy the code