weex开发错误汇总

weex run serve 报UglifyJS错

weex开发错误汇总_第1张图片

ANDROID_HOME环境变量

weex build android需要ANDROID_HOME, 请配置 D:\adt-windows-x86_64\sdk\

无法生成APK

参考: 将weex项目打包的关键点
weex build android可以在D:\GitHub\awesome-project\platforms\android\app\build\outputs下生成APK文件, 运行时却只是在浏览器打开, 网上找到是platforms\android\build.gradle中maven配置问题

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        // 打开这行, 默认是注释掉的
        maven { url "http://mvnrepo.alibaba-inc.com/mvn/repository" }
        // mavenCentral() 注释这行
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
    }
}

allprojects {
    repositories {
        maven { url "http://mvnrepo.alibaba-inc.com/mvn/repository" }
        // mavenCentral()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

再执行weex build android会是下面的界面
weex开发错误汇总_第2张图片

gradle-2.14.1-all解压报错

这个是下载的压缩文件有问题导致的, 下好了copy过去, 或者重新下载
下载地址

 => Will start Android app
============build config============
AppId=>com.alibaba.weex
AppName=>WeexApp
SplashText=>Hello
Weex
WeexBundle=>index.js
if you want to change build config.please modify android.config.json
 => Building app ...
Unzipping C:\Users\mark1\.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv\gradle-2.14.1-all.zip to C:\Users\mark1\.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.(Unknown Source)
        at java.util.zip.ZipFile.(Unknown Source)
        at java.util.zip.ZipFile.(Unknown Source)
        at org.gradle.wrapper.Install.unzip(Install.java:157)
        at org.gradle.wrapper.Install.access$400(Install.java:26)
        at org.gradle.wrapper.Install$1.call(Install.java:67)
        at org.gradle.wrapper.Install$1.call(Install.java:44)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
        at org.gradle.wrapper.Install.createDist(Install.java:44)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)

你可能感兴趣的:(weex开发错误汇总)