Error: Error: Command failed: call gradlew.bat assembleRelease
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':classpath'.
Could not find com.taobao.android:weexplugin-gradle-plugin:1.2.1.
Searched in the following locations:
file:/C:/Users/34784/.m2/repository/com/taobao/android/weexplugin-gradle-plugin/1.2.1/weexplugin-gradle-plugin-1.2.1.pom
file:/C:/Users/34784/.m2/repository/com/taobao/android/weexplugin-gradle-plugin/1.2.1/weexplugin-gradle-plugin-1.2.1.jar
https://jcenter.bintray.com/com/taobao/android/weexplugin-gradle-plugin/1.2.1/weexplugin-gradle-plugin-1.2.1.pom
https://jcenter.bintray.com/com/taobao/android/weexplugin-gradle-plugin/1.2.1/weexplugin-gradle-plugin-1.2.1.jar
https://repo1.maven.org/maven2/com/taobao/android/weexplugin-gradle-plugin/1.2.1/weexplugin-gradle-plugin-1.2.1.pom
https://repo1.maven.org/maven2/com/taobao/android/weexplugin-gradle-plugin/1.2.1/weexplugin-gradle-plugin-1.2.1.jar
Required by:
:android:unspecified
weex add platform android 后,准备通过AS直接编译下在模拟器中运行下看看的。发现执行构建后出现以上的报错。
仔细看的话,会发现关键错误是Could not find com.taobao.android:weexplugin-gradle-plugin:1.2.1.
百度后手动修改了maven的仓库地址,改成阿里云的镜像地址,修改build.gradle地址
http://maven.aliyun.com/nexus/content/groups/public
这里有个很坑的地方,模板工程中的依赖版本是1.2.1,实际上在阿里云镜像中,不存在1.2.1,所以
即使你修改了maven地址后,还是会找不到的。
需要修改下依赖的版本,去阿里云仓库搜索了下后发现存在1.3版本。
image.png
image.png
全部修改后,重新编译,就可以在AS的模拟器中预览app了。
image.png
网友评论