Alexa Auto SDK 4.0构建示例应用报错找不到autovoicechrome.aar
Alexa Auto SDK 4.0示例APK构建报错排查
报错核心信息
构建过程抛出依赖解析失败异常,关键日志如下:
FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':alexa-auto-app:dataBindingMergeDependencyArtifactsLocalRelease'. > Could not resolve all task dependencies for configuration ':alexa-auto-app:localReleaseRuntimeClasspath'. > Could not find :autovoicechrome:. Searched in the following locations: - file:/home/chetan/Projects/Amazon_Alexa/alexa-auto-sdk/aacs/android/sample-app/alexa-auto-app/libs/autovoicechrome.aar - file:/home/chetan/Projects/Amazon_Alexa/alexa-auto-sdk/aacs/android/app-components/alexa-auto-voice-ui/libs/autovoicechrome.aar - file:/home/chetan/Projects/Amazon_Alexa/alexa-auto-sdk/aacs/android/app-components/alexa-auto-voice-interaction/libs/autovoicechrome.aar Required by: project :alexa-auto-app > project :alexa-auto-voice-ui
背景说明:因4.1版本存在其他已知构建问题,本次构建使用4.0版本代码,构建流程参照该版本配套的示例应用说明文档操作。
排查与解决步骤
- 优先补全Git子模块
缺失的autovoicechrome.aar属于仓库附带的子模块二进制依赖,直接克隆主分支代码时如果没加递归拉取参数,就会出现本地文件缺失。进入仓库根目录执行以下命令拉取全量子模块:
执行完成后检查git submodule update --init --recursiveaacs/android/app-components/alexa-auto-voice-ui/libs/路径下是否存在对应aar文件,存在的话直接重新构建即可。 - 手动补全缺失依赖
如果子模块拉取完成后依然找不到该文件,可以从4.0版本对应的官方发布包中提取autovoicechrome.aar,放到上述libs目录下,注意文件名必须完全匹配,不要添加版本号等后缀。 - 校验模块依赖配置
打开alexa-auto-voice-ui模块的build.gradle文件,确认dependencies块中对该依赖的引用是正确的本地文件配置:
如果配置为远程依赖、或者路径拼写错误,修正后再执行构建。implementation files('libs/autovoicechrome.aar') - 清理构建缓存重试
依赖补全、配置确认无误后,先执行清理命令清空旧缓存,再执行构建任务:./gradlew clean ./gradlew assembleLocalRelease
内容的提问来源于stack exchange,提问作者Chetan Jawale
相关产品推荐
相关产品推荐

