[英]Android gradle Upload NDK symbols on every build
I want to upload NDK symbols on every build i do,我想在每次构建时上传 NDK 符号,
Under my Android inside gradle i use to have:在我的 Android 里面 gradle 我曾经有:
applicationVariants.all { variant ->
def variantName = variant.name.capitalize()
println("symbols will be added on varinat ${variantName}")
def task = project.task("ndkBuild${variantName}")
task.finalizedBy project.("uploadCrashlyticsSymbolFile${variantName}")
}
this does not compile anymore since i moved to FireBase:自从我移至 FireBase 后,这不再编译:
Could not get unknown property 'uploadCrashlyticsSymbolFile无法获取未知属性“uploadCrashlyticsSymbolFile”
I don't see this task running.我没有看到此任务正在运行。
I basiclly need this task to run on every build:我基本上需要这个任务在每个构建上运行:
./gradlew app:assembleBUILD_VARIANT\ app:uploadCrashlyticsSymbolFileBUILD_VARIANT
./gradlew app:assembleBUILD_VARIANT\ app:uploadCrashlyticsSymbolFileBUILD_VARIANT
Add this at the bottom of app's build.gradle
outside android {... }
block.将此添加到应用程序的
build.gradle
底部android {... }
块之外。
afterEvaluate {
android.applicationVariants.all { variant ->
def variantName = variant.name.capitalize()
println("symbols will be added on variant ${variantName}")
def task = tasks.findByName("assemble${variantName}")
def uploader = "uploadCrashlyticsSymbolFile${variantName}"
// This triggers after task completion
task?.finalizedBy(uploader)
// This ensures ordering
task?.mustRunAfter(uploader)
}
}
You can try without afterEvaluate
block.您可以尝试不
afterEvaluate
块。 It should still work.它应该仍然有效。
Likely you'd need to use Firebase App Distribution, which permits automatic upload of release build artifacts - and if you have the artifact with the matching debug symbols, they could actually be used - without the matching assembly, the symbols are somewhat irrelevant.您可能需要使用 Firebase App Distribution,它允许自动上传发布构建工件 - 如果您有带有匹配调试符号的工件,它们实际上可以使用 - 如果没有匹配的程序集,这些符号有些无关紧要。
Number 1 is obviously a wrongful assumption, because the documentation clearly states:数字 1 显然是一个错误的假设,因为文档明确指出:
./gradlew app:assembleBUILD_VARIANT app:uploadCrashlyticsSymbolFileBUILD_VARIANT
And this is already answered here .这已经在这里得到了回答。
In order to always upload, one can create a task dependency:为了始终上传,可以创建一个任务依赖项:
assembleRelease.finalizedBy uploadCrashlyticsSymbolFileRelease
This may require setting unstrippedNativeLibsDir
and strippedNativeLibsDir
.这可能需要设置
unstrippedNativeLibsDir
和strippedNativeLibsDir
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.