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
- Create a React Native 0.79.2 project
- Install @juspay-tech/hyperswitch-sdk-react-native@0.2.0
- Install react-native-code-push@8.3.1
- Configure Gradle 8.13
- Run ./gradlew build or yarn android
- Build fails with the error above
Summary
Android build fails when using
@juspay-tech/hyperswitch-sdk-react-nativedue to a type incompatibility in the bundledcodepush.gradlescript. ThePaths.get()method is being called with a GradleDirectoryproperty object instead of aString, causing a method signature mismatch.Environment
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:
Root Cause
In
node_modules/@juspay-tech/hyperswitch-sdk-react-native/android/codepush.gradleat 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