Sentry-react-native: [ANDROID] - Adding source map references error: could not parse JSON response

Created on 25 May 2018  ·  13Comments  ·  Source: getsentry/sentry-react-native

OS:

  • [ ] Windows
  • [x] MacOS
  • [ ] Linux

_Platform:_

  • [ ] iOS
  • [x] Android

Output of node -v && npm -v && npm ls --prod --depth=0

v8.4.0
4.0.5
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── [email protected]
├── [email protected] invalid
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Config:

Sentry.config('https://[email protected]/...', {
   ignoreUrls: [/XXX\.io/, /localhost/],
}).install()

I have following issue:

I am not able to build in release mode with android due to a sourcemap issue

Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
error: could not parse JSON response
  caused by: missing field `version` at line 1 column 35
:app:bundleDevReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

Steps to reproduce:

  • Build for Android e.g:
react-native run-android --variant=devRelease

Actual result:

  • Failure

Expected result:

  • Build should be successful

Most helpful comment

@victormartingarcia Can you please confirm that to content of sentry.properties are the same with the org and project slug on sentry.io?
I suspect it's because you renamed your project/org after you setup your project.

All 13 comments

I assume that your OS has no sentry-cli, can you check that?

The other alternative is to use
cli.executable=node_modules/sentry-cli-binary/bin/sentry-cli in your android/sentry.properties

I'm seeing the same error with Appcenter builds of both iOS and Android platforms:

Android

Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
error: could not parse JSON response
  caused by: missing field `version` at line 1 column 36
:app:bundleReleaseJsAndAssets FAILED

iOS

Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
error: could not parse JSON response
  caused by: missing field `version` at line 1 column 36

Relevant sentry packages for both builds:

├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ [email protected]

This issue is preventing releases, for now I suppose I will disable Sentry sourcemap uploads

@abrel Are you also using appcenter?

I just tried it with a clean project

react-native init Test
cd Test
yarn add react-native-sentry
react-native link
react-native run-ios

everything worked as expected.

├── [email protected]
├── [email protected]
└── [email protected]

Just for the record, I am experiencing this issue as well

````
Processing react-native sourcemaps for Sentry upload.

Analyzing 2 sources
Rewriting sources
Adding source map references
error: could not parse JSON response
caused by: missing field version at line 1 column 32
````

We are looking into that issue right now, we are not able to reproduce it yet though.

Can you guys please prefix the command you are running in your shell with

SENTRY_LOG_LEVEL=debug ...

and post / send the output to [email protected] ?

Output sent to [email protected] :)

@victormartingarcia Thanks this was very helpful, we are almost certain we know what the issue now.
I will keep you guys posted.

@HazAT any suggestion for a dirty fix that let me move on in the meantime?

Right now we cannot build any release version of the app because of this. Well, wecould do that removing react-native-sentry reference for both our android/ios projects, but it's a bummer ;)

@victormartingarcia Can you please confirm that to content of sentry.properties are the same with the org and project slug on sentry.io?
I suspect it's because you renamed your project/org after you setup your project.

@HazAT that's exactly what was happening 😅😅

I've renamed the project and didn't changed it on sentry.properties. Now it works like a charm, thanks!!

Is there any way to override this value on execution time? (ENV var or alike) I'm using fastlane for assembling multiple applications from same android studio project

It is, as shown in the docs ;) https://docs.sentry.io/learn/cli/configuration/

@HazAT thanks man, you saved my life 😂😂
I forgot to change the name in sentry.properties 😅

While I know it's kind of a bad error message we return on the server, I consider this as fixed/not a bug.
Please if you run into this check: https://github.com/getsentry/react-native-sentry/issues/416#issuecomment-395723975

Closing this now.

Was this page helpful?
0 / 5 - 0 ratings