analytics-react-native
analytics-react-native copied to clipboard
Project with path ':segment_sovran-react-native' could not be found in project ':@segment_analytics-react-native'
Related issue:
https://github.com/segmentio/analytics-react-native/issues/699#issue-1424271313
analytics-react-nativeversion: "2.14.0"- Integrations versions (if used):
- React Native version: "0.72.4"
- Android
Steps to reproduce https://github.com/segmentio/analytics-react-native/issues/699#issue-1424271313
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.
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
Upgrade "@segment/analytics-react-native" version to latest.