提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
一、通过cordova打包vue
详细内容参考
https://blog.csdn.net/zeternityyt/article/details/79756944
把build的assetsPublicPath改成这样
试运行vue项目,npm run dev 如果运行成功,则打开终端或者命令窗口,输入npm run build。
打包成功后,把打包后的dist中的文件,包括static文件夹和index.html放到cordova项目中的www的文件夹下。
然后进入cordova项目的文件夹下,执行cordova build android。
打包成功后会输出地址显示apk所在的位置。
二、打包过程遇到的error
1.failed to find ‘android_sdk_root’ environment variable. try setting it manually. failed to find ‘android’ command in your ‘path’. try update your ‘path’ to include path to valid sdk directory.
配置一下ANDROID_SDK_ROOT的环境变量为Android的SDK地址。
详细参考
https://blog.csdn.net/qq_39284848/article/details/79770142
2.Error: Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio
参考
https://blog.csdn.net/qq_23418393/article/details/77940577
版权声明:本文为m0_51426111原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。