Skip to content

Fix build for Expo SDK 54 #1096

@RohovDmytro

Description

@RohovDmytro
  • @segment/analytics-react-native": "^2.21.2"
  • @segment/sovran-react-native": "1.1.3"
  • Integrations versions (if used):
  • React Native version: 0.81.1
  • iOS or Android or both? Android

Steps to reproduce
Using latest Expo SDK 54 which uses "react-native": "0.81.1" leads to build fail due to Segment lib:

> Task :segment_analytics-react-native:compileDebugKotlin FAILED
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:192:9 Unresolved reference 'currentActivity'.
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:197:32 Unresolved reference 'currentActivity'.
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:220:19 Unresolved reference 'currentActivity'.
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:252:9 Unresolved reference 'currentActivity'.
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:254:37 Unresolved reference 'currentActivity'.
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:254:55 Unresolved reference 'intent'.
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:255:22 Unresolved reference 'currentActivity'.
e: file:///Users/rohovdmytro/Projects/cohios/node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt:255:40 Unresolved reference 'intent'.

[Incubating] Problems report is available at: file:///Users/rohovdmytro/Projects/cohios/android/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':segment_analytics-react-native:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.14.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 39s

Expected behavior
Build works.

Actual behavior
Build fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions