如何从weex创建android项目

时间:2017-05-28 21:18:01

标签: weex

我无法从weex添加平台,只能从weexpack

添加
drew@drew-Aspire-E1-571G ~/Work/Weex/awesome-project $ weexpack  platform add android
Error: Current working directory is not a weexpack project

我无法将weex编译为android项目

1 个答案:

答案 0 :(得分:2)

如果你使用weex-toolkit,你应该自己创建一些文件和目录,包括:

显示目录:

  • 网络
  • 平台
  • 插件

文件:

  • android.config.json
  • ios.config.json
  • config.xml中

修改config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.alibaba.weex" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>MyApp1</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>

在当前版本中,您还可以使用weex create创建weexpack项目。

当然,入门套件也可能对您有所帮助:https://github.com/elemefe/weex-vue-starter-kit