【发布时间】:2020-12-03 12:58:15
【问题描述】:
我在 Androidmanifest.xml 文件中添加 android:requestLegacyExternalStorage="true" 后出现构建错误,没有 android:requestLegacyExternalStorage="true" 可以构建。在 android ver 10 设备中无法创建目录,所以我添加了android:requestLegacyExternalStorage="true"。
我是用 node.js cmd 提示构建的。错误如下
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.908 secs
cmd: Command failed with exit code 1 Error output:
F:\Mobile Projects\1652019\FingerTips\OAMobile\platforms\android\build\intermediates\manifests\full\debug\AndroidManifest.xml:39: AAPT: No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android'
F:\Mobile Projects\1652019\FingerTips\OAMobile\platforms\android\build\intermediates\manifests\full\debug\AndroidManifest.xml:39: error: No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android'
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
我试过了,我删除了android平台并再次添加,仍然出现错误,我也安装了这个插件cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=27.+
当我使用这个命令 gradle compileDebug --scan 进行跟踪时,我得到低于 2 的错误
FAILURE:构建完成,失败了 2 次。
1: 任务因异常而失败。
-
在哪里: 脚本'F:\Mobile Projects\1652019\FingerTips\OAMobile\platforms\android\CordovaLib\cordova.gradle' 行:64
-
出了什么问题: 评估根项目“android”时出现问题。
未找到已安装的构建工具。安装 Android 构建工具 19.1.0 或更高版本。
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
2:任务因异常而失败。
- 出了什么问题: 配置根项目“android”时出现问题。
buildToolsVersion 未指定。
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
问候和感谢 阿拉文
【问题讨论】: