AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
1. **生成Android** 在项目中的命令行输入 ``` weex platform add android ``` 在andriod studio中打开模拟器,然后运行以下命令 ``` weex run android ``` ``` ``` >[danger]执行该步骤的前提是安装Android studio,安装过JDK,配置完环境变量 **** **** 2. **使用Android studio打开** 可见在当前weex项目中的platforms文件夹下生成一个Android项目 使用Android studio打开该文件 ![](https://box.kancloud.cn/100fcd3afe8b1d09eb8a73d30714ed64_527x528.png) **** 3. **等待一系列安装乱七八糟的之后,显示如下就可以正常运行** ![](https://box.kancloud.cn/abf689cce34e3d0224268cb210cf68a2_1262x112.png) **** **当然它很有可能不会这么顺利,它会报错报错报错!!!😡来了,错误汇总!!!** >[danger]1. no toolchains巴拉巴拉 少文件七了八的 移步这位大哥@[CodeForCoffee](https://blog.csdn.net/qq_24118527/article/details/82867864) >[success]2. ERROR: The versions of the Android Gradle plugin and Gradle are not compatible. Please do one of the 走@[lvxiangan](https://blog.csdn.net/lvxiangan/article/details/78953921) ![](https://box.kancloud.cn/8eee9e12ae2afb0593ad374273e97c8d_630x312.png) >[warning]3. Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated…… 移步另一个大哥@[Paweł Nadolski](https://stackoverflow.com/questions/44239235/android-gradle-3-0-0-alpha2-plugin-cannot-set-the-value-of-read-only-property) ![](https://box.kancloud.cn/4cd686d0b2fc02583d56e1a7d2b94d4a_741x259.png) 即 ``` android.applicationVariants.all { variant -> variant.outputs.all { outputFileName = "${variant.name}-${variant.versionName}.apk" } } ``` >[info]4. Error:Execution failed for task ':app:javaPreCompileDebug'.Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration. - weexplugin-processor\-1.3.jar (com.taobao.android:weexplugin-processor:1.3) [请走](https://www.jianshu.com/p/601daa5aed8d) ![](https://box.kancloud.cn/6d1afee6dea5e7a12224288818fc3ff6_711x183.png) ``` javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } } ``` **** **** 4. **在手机上打开开发者模式** 百度一下 [oppo手机](https://jingyan.baidu.com/article/91f5db1b1d51be1c7e05e35f.html) **** 5. **Android studio打包该文件** ![](https://box.kancloud.cn/d916e98d78e064ccd055a385d3c07aaf_534x454.png) 在该文件目录下的app-->build-->outputs-->apk-->debug下能看到该文件 发送至手机,安装,打开,可以看到hello world **** **到此,初次血泪之旅结束,拜拜!**