getsentry / sentry-cordova

The official Sentry SDK for Cordova
https://sentry.io/
MIT License
68 stars 55 forks source link

Android crashing with "DSN is required. Use empty string to disable SDK" #301

Closed wongpeiyi closed 1 year ago

wongpeiyi commented 1 year ago

Environment

Error

When launching the built app on a device / emulator, it crashes and I get the following error. Removing and adding the sentry-cordova plugin fixes it, but then it breaks again at some point. I believe either building iOS or cordova prepare before building android again breaks it.

02-12 23:53:02.178 26287 26287 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider io.sentry.android.core.SentryInitProvider: java.lang.IllegalArgumentException: DSN is required. Use empty string to disable SDK.
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.app.ActivityThread.installProvider(ActivityThread.java:8312)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.app.ActivityThread.installContentProviders(ActivityThread.java:7812)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7561)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:226)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:313)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:8741)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
02-12 23:53:02.178 26287 26287 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: DSN is required. Use empty string to disable SDK.
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at io.sentry.Sentry.initConfigurations(Sentry.java:200)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at io.sentry.Sentry.init(Sentry.java:169)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at io.sentry.Sentry.init(Sentry.java:117)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:87)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:56)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at io.sentry.android.core.SentryInitProvider.onCreate(SentryInitProvider.java:27)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.content.ContentProvider.attachInfo(ContentProvider.java:2522)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.content.ContentProvider.attachInfo(ContentProvider.java:2492)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at io.sentry.android.core.SentryInitProvider.attachInfo(SentryInitProvider.java:44)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    at android.app.ActivityThread.installProvider(ActivityThread.java:8307)
02-12 23:53:02.178 26287 26287 E AndroidRuntime:    ... 11 more

Despite what the error says, I have the sentry.properties file in both the /cordova folder and the /cordova/platforms/android folder:

defaults.url=https://sentry.io/
defaults.org=XXX
defaults.project=XXX
auth.token=XXX
cli.executable=corber/cordova/node_modules/@sentry/cli/bin/sentry-cli

Some ideas about things to try would be greatly appreciated.

github-actions[bot] commented 1 year ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀