Recently, in the face of product managers more and more capricious demand, test students more and more fire eye eye eyesight, can not help but feel: WebView is limited – it is time to try more close to the original frame!

What is Weex? The official document defines Weex as “a framework for developing high performance native applications using popular Web development experiences.”

The official documents have instructions on how to use Weex. But when you try to start with the documentation, you may still encounter some unmentioned problems.

Here before encountered problems and solutions to make a record, if we encounter similar situations can refer to processing.

For details about the basic process, see the Weex official document.

SDK installation failure

The first problem at the beginning: WeeX-Toolkit installation fails globally.

Global 消 息 监 视 (sudo NPM I-g) fail on Mac after upgrade. Works fine after downgraded.

To resolve the problem by repairing previously installed modules and cache permissions, execute the following command (make sure to execute it on your own PC) :


                                            
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib
sudo chown -R $(whoami) /usr/local/bin

                                        Copy the code

After the configuration is repaired, the WEEX-Toolkit is successfully installed.

Failed to start iPhone debugging. Procedure

Continue to create projects, run Web demo, join iOS platform support, and run Weex Run iOS to start iOS debugging —

New problems have arisen.

If Xcode is not installed, this step will prompt ios-deploy installation failed:

npm ERR! [email protected] preinstall:./ SRC /scripts/check_reqs.js && xcodebuild

In this case, just install Xcode from the AppStore.

After the first startup, click to confirm the agreement, confirm the installation of the relevant development components, and try weex Run ios again, the problem will not occur.

The installation of CocoaPods

This time ios-deploy was successfully installed, but soon after it was discovered that ios debugging was still unable to start:

Command failed: pod update

/bin/sh: pod: command not found

A search for the error keyword pos update shows that you need to install Cocoapods, which appears to be a third-party open source component library manager for iOS.

Sudo gem install cocoapods, wait for half a day after the message from ruby.taobao.org download failed.

Then it turns out that the site is no longer maintained: the Taobao Gems source is no longer maintained and is now mirrored by Ruby-China

So change the source, online search a few, for a long time are useless.

It is suspected that the Intranet proxy of the company is faulty, but the proxifier does not respond, and the terminal output $http_proxy is the correct proxy address.

Finally, the installation succeeded by manually adding the –http-proxy parameter…

Git/NPM /bower/ PIP /gem image/proxy

installed

After a long time, the environment is finally installed and you can start the project in the iPhone emulator.