使用Cordova build后无法成功显示如图错误 尝试过更换gradle版本 无济于事
如果您需要自定义 build.gradle 文件,您应该创建一个名为build-extras.gradle的兄弟文件。此文件必须放在android平台目录( / platforms / android)中,因此建议您通过附加到before_build挂钩的脚本将其复制。
一个例子如下:
// Example build-extras.gradle
// This file is included at the beginning of `build.gradle`
ext.cdvDebugSigningPropertiesFile = '../../android-debug-keys.properties'
// When set, this function allows code to run at the end of `build.gradle`
ext.postBuildExtras = {
android.buildTypes.debug.applicationIdSuffix = '.debug'
}
请注意,插件还可以通过以下方式包含build-extras.gradle文件:
<framework src="some.gradle" custom="true" type="gradleReference" />