-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry mapping file upload task is missing from version 4.3.0 #713
Comments
hi @ZeeshanShabbir, thanks for the report! Presumably you're using DexGuard, right? I think the issue is most likely a consequence of this PR. We'll probably need a bit more logs from you, e.g. what tasks have run in the build. You could also send them internally via your assigned solutions engineer, or directly to me at roman@sentry.io. Thank you! |
Hey @stefanosiano & @romtsn - I've added comments to the internal Jira ticket |
@Angelodaniel thanks, we'll discuss in our sync today |
a similar problem was reported over Discord: https://discord.com/channels/621778831602221064/1245430650635288729/1245430650635288729 seems like when the play-publisher-plugin task is executed (e.g. |
We are still facing this issue that sentry mapping files aren’t uploaded still. We are using sentry android 7.11.0 and plugin version is 4.9.0. We are using the
|
@ZeeshanShabbir could you post a little bit more log output? Is the |
@romtsn Yeah I coudn't find the |
Hey @romtsn, did you manage to have any update on this 🙏 |
Hi @romtsn, it's been a while. Do we have any update or estimate on when this issue will be resolved? |
After some investigation I unfortunately have to conclude that our Sentry Android Gradle Plugin won't work with DexGuard for now. The reason is quite simple: DexGuard runs very late in the build process, giving our Plugin no chance to inject the required mapping UUID based on the output of DexGuard. For an DexGuard enabled app, the task graph looks like the following. As you can see, our sentry tasks runs way too early:
If we would run our tasks after DexGuard, it would also mean that we'd need to re-package and re-sign the app, which seems to be a bigger and brittle effort. Let me reach out to folks from DexGuard, maybe we can work on a solution together. In the meantime you can work around this issue by injecting a matching UUID yourself.
<application>
<meta-data
android:name="io.sentry.proguard-uuid"
android:value="${sentryProGuardUuid}" />
This provides the android.applicationVariants.configureEach { variant ->
var flavor = variant.getMergedFlavor()
// Add additional identifiers if necessary, e.g. git commit hash, GITHUB_RUN_ID / GITHUB_RUN_NUMBER
var identifier = "${variant.applicationId}-${variant.versionCode}-${variant.versionName}-${variant.name}"
var proguardUuid = UUID.nameUUIDFromBytes(identifier.getBytes(Charset.forName("UTF-8"))).toString()
// set mapping uuid as placeholder for AndroidManifest.xml
flavor.manifestPlaceholders = ["sentryProGuardUuid": proguardUuid]
// custom upload task, requires sentry-cli to be installed
tasks.register("uploadSentryMappings${variant.name.capitalize()}", Exec) {
commandLine(
"sentry-cli",
"upload-proguard",
"--uuid",
proguardUuid,
project.layout.buildDirectory.dir("outputs/dexguard/mapping/apk/${variant.name}/mapping.txt").get().toString(),
"--version-code",
variant.versionCode.toString(),
"--app-id",
variant.applicationId,
"--version",
variant.versionName
)
// path to the sentry.properties file, defining org and project
var propertiesPath = new File(project.layout.projectDirectory.asFile.parentFile, "sentry.properties")
environment("SENTRY_PROPERTIES", propertiesPath.toString())
// if not set already, define the auth token for upload here
// environment("SENTRY_AUTH_TOKEN", "<auth-token>")
}
}
./gradlew :app:assembleRelease && ./gradlew :app:uploadSentryMappingsRelease |
Thanks @markushi for such great response. The point is only injecting a matching UUID on the manifest and using the same UUID for uploading, right? My question is because we have a different pipeline and I was wondering if we could pass this "uuid" as an ambient variable to the Gradle and then execute the Does my plan make sense? |
Yes, you're right: It's all about injecting a matching UUID. It doesn't really matter who/how the UUID is generated. As long as it ends up in the The Sentry Android Gradle Plugin is using |
Gradle Version
8.7
AGP Version
8.4.0
Code Minifier/Optimizer
Dexguard
Version
4.6.0
Sentry SDK Version
7.9.0
Steps to Reproduce
We are using https://github.com/Triple-T/gradle-play-publisher to generate and upload our app bundles to the distribution channel. We recently noticed that the sentry mapping file is missing on further investigation we found out that issue started to happen after we updated to 4.4.0 and 4.6.0 also have this issue.
After enabling debug for sentry configuration we see following logs.
Expected Result
The mapping file should be uploaded to sentry
Actual Result
The mapping file upload task is missing hence, the mapping file is not uploaded to sentryThe mapping
┆Issue is synchronized with this Jira Improvement by Unito
The text was updated successfully, but these errors were encountered: