Skip to content
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

Android build failed #409

Closed
2 of 5 tasks
erez-guesty opened this issue May 15, 2018 · 8 comments
Closed
2 of 5 tasks

Android build failed #409

erez-guesty opened this issue May 15, 2018 · 8 comments
Assignees

Comments

@erez-guesty
Copy link

erez-guesty commented May 15, 2018

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

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

v8.11.1
6.0.1
[email protected]
[email protected]
[email protected]

node_modules/react-native-sentry/android/src/main/java/io/sentry/RNSentryModule.java:262: error: incompatible types: ReadableArray cannot be converted to ReadableNativeArray
                addExceptionInterface(eventBuilder, exception.getString("type"), exception.getString("value"), stacktrace.getArray("frames"));

I have following issue:

Failed to build android apk

Steps to reproduce:

  • run on termial react-native run-android

Actual result:
node_modules/react-native-sentry/android/src/main/java/io/sentry/RNSentryModule.java:262: error: incompatible types: ReadableArray cannot be converted to ReadableNativeArray
addExceptionInterface(eventBuilder, exception.getString("type"), exception.getString("value"), stacktrace.getArray("frames"));

Expected result:

  • build succeed
@RobPando
Copy link

RobPando commented May 15, 2018

Was just about to open this very same issue. I am on [email protected] and [email protected], I thought it might have to do something wit the version so I updated the library to 0.36 and I get a successful build but cannot do anything because I get React Native version mismatch so it seems that the new version of this library is only compatible with RN 55? if so the readme needs to be updated.

Update

I was completely wrong about the RN version mismatch. I did have to do an extra step tho, in the android/app/build.gradle I added (for my RN version case) compile ('com.facebook.react:react-native:0.52.0') { force = true } and with [email protected] it builds and works perfect again, it seems that the issue was solved in 0.34.1 #354 . So just update the library and you should be good to go.

@erez-guesty
Copy link
Author

@RobPando
I saw that hack, but when you'll upgrade react-native version you'll have to manually update this number as well... could be fix for now but not as a solution.

@m-vdb
Copy link

m-vdb commented May 15, 2018

Updating to 0.36.0 fixed the build issue for me:

v6.11.2
5.3.0
<myproject>
├── [email protected]
├── [email protected]
└── [email protected]

But I get the same version mismatch issue... The hack works but it is definitely a hack and this will be an issue when upgrading RN versions.

@foxmicha
Copy link

foxmicha commented May 15, 2018

It seems like it's trying to compile the react-native-sentry projects using a different React-Native version than what is currently installed in the node_modules folder.

I am on RN v0.51 as well. I haven't done an npm install of react-native-sentry since December. The build worked fine yesterday and breaks today.

Looks like this is an issue with the Maven repository, as discussed here

@HazAT
Copy link
Member

HazAT commented May 22, 2018

So this issue is not really related to Sentry, more like react-native / gradle itself.
Please use a version > 0.34.1 which should fix this issue.

@HazAT HazAT closed this as completed May 22, 2018
@HazAT HazAT self-assigned this May 22, 2018
@m-vdb
Copy link

m-vdb commented May 23, 2018

@HazAT why do you say it fixes the issue?

@foxmicha
Copy link

@m-vdb Check the link in my comment above. The reason your build was breaking was because of a bad react-native dependency that was uploaded to the maven / jcenter repositories. The bad dependency caused the older Sentry versions to attempt to be built using newer libraries that didn't have backwards compatibility support for the older Sentry versions. Now that the bad react-native dependency has been removed from maven / jcenter this error should be resolved.

@m-vdb
Copy link

m-vdb commented May 29, 2018

thanks! Don't why I didn't see that. I especially read this comment that explains the issue: facebook/react-native#13094 (comment)

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

No branches or pull requests

5 participants