Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project with path ':segment_sovran-react-native' could not be found in project ':@segment_analytics-react-native' #1039

Open
Kevinparra535 opened this issue Dec 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Kevinparra535
Copy link

Related issue:

#699 (comment)

  • analytics-react-native version: "2.14.0"
  • Integrations versions (if used):
  • React Native version: "0.72.4"
  • Android

Steps to reproduce
#699 (comment)

Expected behavior
Expected behavior

$ yarn config:staging && react-native run-android --appIdSuffix debug

...

BUILD SUCCESSFUL in 1m 34s

Actual behavior

$ yarn config:staging && react-native run-android --appIdSuffix debug

...

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/user/project_root/node_modules/@segment/analytics-react-native/android/build.gradle' line: 136

* What went wrong:
A problem occurred evaluating project ':@segment_analytics-react-native'.
> Project with path ':segment_sovran-react-native' could not be found in project ':@segment_analytics-react-native'.

* 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

BUILD FAILED in 13s

    at makeError (/Users/user/project_root/node_modules/execa/index.js:174:9)
    at /Users/user/project_root/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/Users/user/project_root/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:106:5)
    at async Command.handleAction (/Users/user/project_root/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@Kevinparra535 Kevinparra535 added the bug Something isn't working label Dec 30, 2024
@Kevinparra535
Copy link
Author

I've found a temporary solution; you need to add this line to /node_modules/@segment/analytics-react-native/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt#L128

    val appVersion: String = pInfo.versionName ?: "Unknown"

Packages Version:

    "@segment/analytics-react-native": "2.14.0",
    "@segment/sovran-react-native": "1.0.3",
    "react": "18.2.0",
    "react-native": "0.72.4",

⚠️ This only works on the Android build, you just need to add "Unknown" to this line of code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant