Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MOB-12247] Fix Sourcemaps Script with Old Gradle #970

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

Merged
merged 3 commits into from
Apr 27, 2023

Conversation

a7medev
Copy link
Contributor

@a7medev a7medev commented Apr 25, 2023

Description of the change

Problem

The current sourcemaps upload script uses a Groovy method called endsWithIgnoreCase which is supported in Groovy 3 used by Gradle 7, while older versions of Gradle use older versions of Groovy (e.g. Gradle 6.9 uses Groovy 2.5.12) which don’t include this method. Hence, the build fails with the error:

FAILURE: Build failed with an exception.

* Where:
Script '[redacted]/node_modules/instabug-reactnative/android/sourcemaps.gradle' line: 8

* What went wrong:
No signature of method: java.lang.String.endsWithIgnoreCase() is applicable for argument types: (String) values: [bundleReleaseJsAndAssets]

Solution

We can replace the usage of endsWithIgnoreCase with another well-supported approach like .toLowerCase().endsWith (tested with React Native 0.66.1, Gradle 6.9, Groovy 2.5.12).

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fixes #969

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests

Code review

  • This pull request has a descriptive title and information useful to a reviewer
  • Issue from task tracker has a link to this pull request

@a7medev a7medev force-pushed the fix/sourcemaps-upload-gradle-support branch from e377e43 to 6948b9a Compare April 25, 2023 11:43
@a7medev a7medev marked this pull request as ready for review April 25, 2023 11:44
@InstabugCI
Copy link
Collaborator

InstabugCI commented Apr 25, 2023

Coverage Report

Label Coverage Status
JavaScript 96.8%
Android 47.8%
iOS 39.0%

Generated by 🚫 dangerJS against 1473b5a

@DavidMina96
Copy link
Contributor

@a7medev LGTM. 👍
Please add a changelog item for it.

@a7medev
Copy link
Contributor Author

a7medev commented Apr 26, 2023

@DavidMina96 Thanks for the note, I updated it 🙏🏼

CHANGELOG.md Outdated

### Fixed

- Fix the Android sourcemaps upload script in older versions of Gradle ([#970](https://github.com/Instabug/Instabug-React-Native/pull/970)), closes [#969](https://github.com/Instabug/Instabug-React-Native/issues/969).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Fix an issue with the Android sourcemaps upload script, causing the build to fail on older versions of Gradle (#970), closes #969.

@DavidMina96 DavidMina96 self-requested a review April 27, 2023 14:29
@a7medev a7medev merged commit a7fdba8 into dev Apr 27, 2023
@a7medev a7medev deleted the fix/sourcemaps-upload-gradle-support branch April 27, 2023 14:33
HeshamMegid pushed a commit that referenced this pull request May 30, 2023
* Fix sourcemaps script with old Gradle

* Update CHANGELOG

* Update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants