fix build multi variant releases #4125
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
When I want to build for multi-variant projects, it gives me an error.
During troubleshooting, I realized that for all variants, only one version of the source map is uploaded.
By checking the sentry .gradle file, I realized that three variables are defined globally, but they are used inside the loop, and this makes these three variables retain the value of the last round of the loop. For this reason, the duplicate source map is uploaded.
For example, if I want to build for armeabi-v7a, x86, arm64-v8a and x86_64 variants, the source map for x86_64 will be uploaded four times because it is the last round of the loop.
💡 Motivation and Context
This pull request solves the problem of duplicate source map upload for all project variants.
💚 How did you test it?
Just create a multi-variant project and build it.
This is my build logs. As you can see, one version has been uploaded for all source map upload tasks:
As can be seen in the logs above, this log has been repeated four times:
Uploading sourcemaps for release [email protected]+8009004 distribution 8009004
📝 Checklist
sendDefaultPII
is enabled