记录一个flutter打包aar异常问题
执行flutter build aar后报错:
FAILURE: Build failed with an exception.* Where:
Initialization script '/Users/temp/Documents/flutter/packages/flutter_tools/gradle/aar_init_script.gradle' line: 19* What went wrong:
Android property not found.* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 17sGradle task assembleAarDebug failed with exit code 0.
【记录一个flutter打包aar异常问题】问题定位flutter目录下aar_init_script.gradle文件,插入throw代码段,即可显示哪里出错。
if (!project.hasProperty("android")) {
throw new GradleException(project.toString())
throw new GradleException("Android property not found.")
}
重新执行build操作
FAILURE: Build failed with an exception.* Where:
Initialization script '/Users/temp/Documents/flutter/packages/flutter_tools/gradle/aar_init_script.gradle' line: 19* What went wrong:
project ':url_launcher_macos'* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
显示url_launcher_macos出错,到flutter目录下隐藏文件.pub-cache内的hosted目录下
文章图片
image.png
将pub.dartlang.org与pub.flutter-io.cn文件夹目录下的url_launcher_macos相关缓存都删除了,重新执行build aar操作,打包成功。
Running Gradle task 'assembleAarDebug'...
Running Gradle task 'assembleAarDebug'... Done57.0s
? Built build/host/outputs/repo.
Running Gradle task 'assembleAarProfile'...Running Gradle task 'assembleAarProfile'... Done126.0s (!)
? Built build/host/outputs/repo.
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done96.2s
? Built build/host/outputs/repo.
推荐阅读
- 一个人的旅行,三亚
- 一个小故事,我的思考。
- 一个人的碎碎念
- 20170612时间和注意力开销记录
- 七年之痒之后
- 我从来不做坏事
- 异地恋中,逐渐适应一个人到底意味着什么()
- 迷失的世界(二十七)
- live|live to inspire 一个普通上班族的流水账0723
- 遗憾是生活的常态,但孝顺这件事,我希望每一个人都不留遗憾