Skip to content

Commit dc89663

Browse files
committed
Only check for NDK if it's bundled with the app
1 parent 31d1657 commit dc89663

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

  • sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android

sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/SdkInitTests.kt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import io.sentry.Sentry
88
import io.sentry.SentryIntegrationPackageStorage
99
import io.sentry.android.core.AndroidLogger
1010
import io.sentry.android.core.CurrentActivityHolder
11+
import io.sentry.android.core.NdkIntegration
1112
import io.sentry.android.core.SentryAndroidOptions
1213
import io.sentry.assertEnvelopeTransaction
1314
import io.sentry.protocol.SentryTransaction
@@ -262,11 +263,10 @@ class SdkInitTests : BaseUiTest() {
262263
}
263264

264265
private fun assertDefaultIntegrations() {
265-
for (integration in listOf(
266+
val integrations = mutableListOf(
266267
"UncaughtExceptionHandler",
267268
"ShutdownHook",
268269
"SendCachedEnvelope",
269-
"Ndk",
270270
"AppLifecycle",
271271
"EnvelopeFileObserver",
272272
"AnrV2",
@@ -275,7 +275,17 @@ class SdkInitTests : BaseUiTest() {
275275
"UserInteraction",
276276
"AppComponentsBreadcrumbs",
277277
"NetworkBreadcrumbs"
278-
)) {
278+
)
279+
280+
// NdkIntegration is not always available, so we check for its presence
281+
try {
282+
Class.forName(NdkIntegration.SENTRY_NDK_CLASS_NAME)
283+
integrations.add("Ndk")
284+
} catch (_: ClassNotFoundException) {
285+
// ignored, in case the app is build without NDK support
286+
}
287+
288+
for (integration in integrations) {
279289
assertTrue(SentryIntegrationPackageStorage.getInstance().integrations.contains(integration), "Integration $integration was expected, but was not registered")
280290
}
281291
}

0 commit comments

Comments
 (0)