question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle sync failure

See original GitHub issue

OS:

  • MacOS

Platform:

  • Android

SDK:

  • @sentry/react-native

SDK version: 4.9.0, 4.10.0

react-native version: 0.68.5

Are you using Expo?

  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

I have following issue:

Gradle sync failure, and could not build project

Steps to reproduce:

  • Updated react-native sentry package from 4.8.0 to 4.9.0 and modified android/build.gradle:
   implementation platform('io.sentry:sentry-bom:6.8.0')
   implementation 'io.sentry:sentry-android'
  • Sync gradle

Actual result:

groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.containsKey() is applicable for argument types: (String) values: [collectModulesScript]
Possible solutions: contains(java.lang.Object), containsAll(java.util.Collection), contains(java.lang.Object), containsAll([Ljava.lang.Object;)
	at sentry_2za3pj5s286bijx5l10rp3qdc$_run_closure1$_closure6$_closure7$_closure11.doCall(redacted/node_modules/@sentry/react-native/sentry.gradle:166)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.util.internal.ClosureBackedAction.execute(ClosureBackedAction.java:72)
	at org.gradle.util.internal.ConfigureUtil.configureTarget(ConfigureUtil.java:155)
	at org.gradle.util.internal.ConfigureUtil.configureSelf(ConfigureUtil.java:131)
	at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:619)
	at org.gradle.api.DefaultTask.configure(DefaultTask.java:309)
	at org.gradle.api.DefaultTask.configure(DefaultTask.java:45)
	at org.gradle.util.internal.ConfigureUtil.configure(ConfigureUtil.java:104)
	at org.gradle.util.internal.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:167)
	at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:362)
	at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:75)
	at org.gradle.api.internal.tasks.DefaultTaskContainer_Decorated.create(Unknown Source)
	at jdk.internal.reflect.GeneratedMethodAccessor802.invoke(Unknown Source)

Expected result:

  • No problem with sync, build

fyi, After a quick look, In sentry.gradle

def config = project.hasProperty("sentryCli") ? project.sentryCli : [];

returning []. and so config.containsKey(...) throws above error. I hot-patched config.containsKey(A) to config.A, but I don’t know this is the solution. Please let me know if a sentryCli settings should to be updated to somewhere or fix the issue.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:6
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
nandantalcommented, Nov 30, 2022

Fixing the version to 4.8.0 works, @sentry/react-native": "4.8.0",

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error running android: Gradle project sync failed. Please fix ...
It could be that you are using gradle in offline mode. To uncheck it go to File > Settings > ...
Read more >
Different Ways to fix "Error running android: Gradle project ...
Method 1: Restarting your project using Invalidate Caches and Restart option ; Method 2: Sync your project with Gradle files ; Method 3:...
Read more >
Fix: Gradle Project Sync Failed - Appuals.com
What causes the error message “Gradle Project Sync Failed” in Android Studio? · Solution 1: Checking Internet Connection · Solution 2: Disabling ...
Read more >
Troubleshoot Android Studio
Project sync issues · Open your gradle.properties file in Android Studio. · Add the following line to the file: org.gradle.jvmargs=-Djava.net.
Read more >
Gradle sync fails with no error message when Gradle project ...
Gradle sync fails with no error message when Gradle project name equals IntelliJ source set module name ... It will fail to write...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found