firebase-android-sdk: Task 'uploadCrashlyticsSymbolFileRelease' not found in root/app project
Environment
- Android Studio version: 3.6.1
- Firebase Gradle Plugin: 2.0.0-beta02
- Firebase Component: Firebase Crashlytics NDK
- Component version: 17.0.0-beta01
Problem
Tasks to upload debug symbols to Crashlytics are not generated.
I have created a template project that Android Studio provides by default and set up Firebase Crashlytics NDK as described here https://firebase.google.com/docs/crashlytics/ndk-reports-new-sdk#enable-symbol-uploading. Project successfully compiled (release build type) and appeared in Firebase Console but when I try to call gradlew uploadCrashlyticsSymbolFileRelease
there is an error:
Task 'uploadCrashlyticsSymbolFileRelease' not found in root project 'Template'.
or
Task 'uploadCrashlyticsSymbolFileRelease' not found in project 'app'.
Also, I do not forget to add this code to build type release:
buildTypes {
getByName("release") {
.....
firebaseCrashlytics {
nativeSymbolUploadEnabled = true
}
.....
}
}
Steps to reproduce:
- Make template project in android studio
- Set up Firebase Crashlytics SDK (https://firebase.google.com/docs/crashlytics/get-started-new-sdk?platform=android)
- Set up Firebase Crashlytics NDK (https://firebase.google.com/docs/crashlytics/ndk-reports-new-sdk#enable-symbol-uploading)
Expexted results
After assembleRelease
command can call gradlew :app:uploadCrashlyticsSymbolFileRelease
Real results
Tasks uploadCrashlyticsSymbolFile<BuildVariant>
are not even generated
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (4 by maintainers)
I used
withGroovyBuilder
to work around.tldr: you need to case buildType to
ExtensionAware
for correct behavior, using the following should fix your issues.The problem is that the way kotlin dsl works is by adding an extension method
configure()
to allExtensionAware
classes. WhileBuildType
isExtensionAware
at runtime, it is not declared in its definition, as a result kotlin does not callconfigure()
on the buildType, but on the project itself, this results in incorrect behavior.Please reopen the issue if the above does not solve the problem
I did not find any solution except that I made this piece of code in groovy and imported it into kts. But this also not fully work because Firebase Crashlytics NDK throws
NullPointerException
. Issue #1357The problem is really that I use
build.gradle.kts
instead ofbuild.gradle
. I think, that the language (KTS or Groovy) should not affect the creation of tasks and the whole Crashlytics plugin. Also withbuild.gradle.kts
the taskgenerateCrashlyticsSymbolFileRelease
always failed withNullPointerException (no message)