Skip to content

Sentry won't compile if SDK Tools 31 are not installed #6054

@Martinocom-Switcho

Description

@Martinocom-Switcho

What React Native libraries do you use?

React Navigation

Are you using sentry.io or on-premise?

sentry.io (SaS)

Are you using any other error monitoring solution alongside Sentry?

No

Other Error Monitoring Solution Name

No response

@sentry/react-native SDK Version

8.9.1

How does your development environment look like?

MacBook Pro M2  v15.7.4 (24G517)
Expo 54 (CNG)
Android SDK 36 + SDK Tools 36+35

Sentry.init()

  Sentry.init({
    integrations: [
      Sentry.breadcrumbsIntegration({ fetch: false, xhr: true }),
      Sentry.graphqlIntegration({ endpoints: [Env.EXPO_PUBLIC_API_URL + '/v2/graphql'] })
    ],
    dsn: Env.EXPO_PUBLIC_SENTRY_KEY,
    environment: Env.EXPO_PUBLIC_SENTRY_ENV,
    enabled: SENTRY_ENABLED_ENVS.includes(Env.EXPO_PUBLIC_NAME),
    sendDefaultPii: true,
    release: `${Application.applicationId}@${Application.nativeApplicationVersion}`,
    dist: Application.nativeBuildVersion || '1',
    appHangTimeoutInterval: 3,
    beforeBreadcrumb: (breadcrumb, _) => {
      if (breadcrumbToIgnore(breadcrumb)) {
        return null;
      }

      return withGraphQLBreadcrumb(withTouchBreadcrumb(breadcrumb));
    },
    denyUrls: [REACHABILITY_URL]
  });

Steps to Reproduce

  1. Install only SDK 36 and SDK Tools 36 + 35
  2. Update sentry from 7.x to 8.x
  3. Try to build with any of available commands (directly gradle or expo ones)

Expected Result

  1. Build completes without errors.
  2. expo-handler from @sentry/react-native/android/expo-handler uses the safeExtGet to get the values
def safeExtGet(prop, fallback) {
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

Actual Result

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':sentry-react-native-expo:generateDebugRFile'.
> Failed to find target with hash string 'android-31' in: /Users/<user>/Library/Android/sdk

Error: /Users/<user>/Developer/mobile-app/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a exited with non-zero code: 1

Proposed fix

It's fixed if setting that value to 36 instead of 31. So probably using safeExtGet in that subproject would be enough.

Metadata

Metadata

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions