variant.mergeAssets.outputDir now returns Provider<Directory> in AGP 3.4.0, instead of a File.
That means the plugin will not be able to store the sentry-debug-meta.properties file in the final APK.
Yeah, for me, the Sentry Gradle Plugin is creating a sentry-debug-meta.properties file in this directory on every build:
property(interface org.gradle.api.file.Directory, map(property(interface org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /
path/
to/
project/
build))))/
Note that on Windows, the build fails with the following error for the same reason:
error: The filename or extension is too long. (os error 206)
[... SNIP ...]
> Process 'command 'cmd'' finished with non-zero exit value 1
Setting SENTRY_LOG_LEVEL=info shows the following command run:
"C:\\Users\\me\\AppData\\Local\\Temp\\.sentry-cli4700052644997814422.exe" "upload-proguard" "--android-manifest" "C:\\path\\to\\my\\project\\app\\build\\intermediates\\merged_manifests\\release\\AndroidManifest.xml" "--write-properties" "property(interface org.gradle.api.file.Directory, map(property(interface org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\\path\\to\\my\\project\\app\\build))))/sentry-debug-meta.properties" "C:\\path\\to\\my\\project\\app\\build\\outputs\\mapping\\app\\release\\mapping.txt"
Any info on when the fix for this might get merged & released? Without the fix, Sentry doesn't de-obfuscate stack traces when using the newer gradle (big problem when using CI where you can't manually move the properties file to the right location), and is basically useless.
This is high on the priorities list and we should have something released relatively soon
Sorry for the delay on this. We'll investigate it.
Any info on when the fix for this might get merged & released? Without the fix, Sentry doesn't de-obfuscate stack traces when using the newer gradle (big problem when using CI where you can't manually move the properties file to the right location), and is basically useless.
As a work around, you can pull the sentry-debug-metadata.properties from your build artifact and upload it via Sentry CLI.
@bruno-garcia You seem to have released 1.7.23 yesterday, but apparently the Gradle plugin artefact was not updated and is still on 1.7.22:
https://search.maven.org/search?q=io.sentry
Could you please have a look at this? Thank you!
My bad. It's out now on maven central.
Please give it a spin and feel free to reopen if something is wrong.
We'll add more love to this plugin soon too btw.
Same issue with Android Gradle Plugin 3.4.1 and Gradle 5.1.1 with io.sentry:sentry-android-gradle-plugin:1.7.23.
Signed Apps cannot be built because of this warning.
Same issue with Android Gradle Plugin 3.4.1 and Gradle 5.1.1 with io.sentry:sentry-android-gradle-plugin:1.7.23.
Can you show us the snippet of build.gradle where the Sentry Gradle plugin is applied?
Signed Apps cannot be built because of this warning.
Which warning are you referring to?
In my gradle file :
apply plugin: 'io.sentry.android.gradle'
....
sentry {
// Disables or enables the automatic configuration of proguard
// for Sentry. This injects a default config for proguard so
// you don't need to do it manually.
autoProguardConfig true
// Enables or disables the automatic upload of mapping files
// during a build. If you disable this you'll need to manually
// upload the mapping files with sentry-cli when you do a release.
// autoUpload true
}
and i get this message :
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app
@xi67 that's another problem then.
Are you still seeing the sentry-debug-metadata.properties being placed in a meaningless directory (that is what we have been discussing in this issue) or are you just seeing this warning logged by Gradle?
If the latter, then:
@bruno-garcia I think the Sentry Gradle plugin has not been updated to handle a mergeAssetsProvider yet (see here)
And what about error: The filename or extension is too long. (os error 206)?
@Revertron I guess that error was showing up on Windows because the plugin was trying to create a (wrongly named) file with an extremely long (and wrong, again) name.
Are you still seeing that error on Windows?
Yes, on Windows, and only if the "Generate signed APK" is runned from Android Studio (3.4.2).
But if I try to build it from command line by gradlew.bat, I don't see that error, and all builds normally.
That's interesting!
I suppose you are building a release version of your app on the command line with Gradle (e.g. gradlew.bat assembleRelease), aren't you?
Can you also make 100% sure you are using the latest Sentry Gradle plugin?
Yep.
I think it's latest: 'io.sentry:sentry-android-gradle-plugin:1.7.23'
@Revertron I have a feeling this should probably be tracked in a new issue :)
In the meanwhile at least everything is ok when building via command line, so there is a viable workaround.
@ninniuz @bruno-garcia I think this should be re-opened ... I'm still seeing the original issue
the sentry-debug-metadata.properties being placed in a meaningless directory
on 1.7.27
@nolanamy Can you please give us more details of your setup?
Ideally a reproducible repo so we can debug it through and make a fix quickly.
@bruno-garcia Agh, my bad. I'd updated the library but not the gradle plugin 馃う鈥嶁檪 Thanks
Most helpful comment
This is high on the priorities list and we should have something released relatively soon