42

记一次使用angular自动编译andriod APK的绕坑经历

 5 years ago
source link: https://www.wencst.com/archives/1644?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

背景

前端架构师使用angular JS作为框架,打包android APK。

程序已经完成,需要使用自动编译功能来检测服务。

问题

问题一:JDK需要使用1.8,其他版本目前不支持。

问题二:android-sdk安装问题

npm run build:android

build失败,提示:

……

Please install the Android build tools version 19.1.0 or higher.

……

这个主要是因为android-sdk安装的问题。android-sdk安装时,某些插件没有安装完整。

需要安装:

//安装platform-tools、platforms;android-28、build-tools;28.0.3插件
sdkmanager "platform-tools" "platforms;android-28"

问题三:缺少文件

提示:File ~/.android/repositories.cfg could not be loaded.

这个问题因为缺少文件导致。需要将文件创建即可。

问题四:缺少插件

Warning: Failed to find package build-tools

//查看所有的可用插件
sdkmanager --list
sdkmanager "build-tools;28.0.3"

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK