juspay / juspay/hyperswitch-sdk-react-native

Android build failure: Type incompatibility in codepush.gradle - Paths.get() expects String but receives Directory property

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
5
Forks
7
PR merge metrics
No merged PRs in 30d

Description

## Summary
Android build fails when using `@juspay-tech/hyperswitch-sdk-react-native` due to a type incompatibility in the bundled `codepush.gradle` script. The `Paths.get()` method is being called with a Gradle `Directory` property object instead of a `String`, causing a method signature mismatch.

## Environment
- **React Native:** 0.79.2
- **Hyperswitch SDK:** @juspay-tech/hyperswitch-sdk-react-native@0.2.0
- **Gradle:** 8.13
- **Kotlin:** 2.0.21
- **Compile SDK:** 35
- **Target SDK:** 35
- **Min SDK:** 28
- **Node:** >=18
- **OS:** macOS darwin 25.2.0

## Error Message
FAILURE: Build failed with an exception.
Where:
Script '/path/to/node_modules/@juspay-tech/hyperswitch-sdk-react-native/android/codepush.gradle' line: 30
What went wrong:
No signature of method: static java.nio.file.Paths.get() is applicable for argument types: (o.g.a.i.f.DefaultFilePropertyFactory$DefaultDirectoryVar, String) values: [extension 'react' property 'root', /node_modules]
Possible solutions: get(java.net.URI), get(java.lang.String, [Ljava.lang.String;), grep(), getAt(java.lang.String), wait(), any()
Try:
> Run with --stacktrace option to get the stack trace.

## Root Cause
In `node_modules/@juspay-tech/hyperswitch-sdk-react-native/android/codepush.gradle` at **line 30**:

nodeModulesPath = Paths.get(config.root, "/node_modules")

The config.root is a Gradle Directory property object (DefaultFilePropertyFactory$DefaultDirectoryVar), but Paths.get() expects String arguments, causing a type mismatch error with Gradle 8.x.

## Steps to Reproduce

1. Create a React Native 0.79.2 project
2. Install @juspay-tech/hyperswitch-sdk-react-native@0.2.0
3. Install react-native-code-push@8.3.1
4. Configure Gradle 8.13
5. Run ./gradlew build or yarn android
6. Build fails with the error above

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.