-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Component
-
formulus (React Native mobile app)
-
formulus-formplayer (React web app)
-
synkronus (Go backend server)
-
synkronus-cli (Command-line utility)
-
Documentation
-
Other (please specify)
User Story
As a developer, I want to build and run the Android app so that I can test and develop the formulus mobile application.
Description
The Android build fails with a "Cannot convert 'null' to File" error when local.properties exists but doesn't contain the required keystore properties. The build.gradle file attempts to use null values for release signing configuration without proper null checking.
Details
- When does this bug occur? Always, when running
npx react-native run-androidandlocal.propertiesexists but doesn't containFORMULUS_RELEASE_STORE_FILEproperty - What triggers the bug? The build process evaluates the release signing configuration even when the keystore properties are not set
- Location:
formulus/android/app/build.gradleline 114
Steps to Reproduce
- Ensure
formulus/android/local.propertiesexists (it's auto-generated by Android Studio) - Verify that
local.propertiesdoes NOT containFORMULUS_RELEASE_STORE_FILEproperty - Run
npx react-native run-androidfrom the formulus directory - Observe the build failure
Expected Behavior
The build should succeed for debug builds even when release keystore properties are not configured. The release signing configuration should only be set up when the keystore properties are actually present in local.properties.
Actual Behavior
Build fails with the following error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/macbookpro/OpenSource/ode/formulus/android/app/build.gradle' line: 114
* What went wrong:
A problem occurred evaluating project ':app'.
> Cannot convert 'null' to File.
Acceptance Criteria
- The build succeeds for debug builds when keystore properties are not set
- The release signing configuration is only applied when keystore properties exist
- The bug can be reproduced using the steps above
- The fix properly handles null values before passing them to
rootProject.file()
Environment
OS: macOS 25.1.0 (darwin)
Node.js version:
Go version:
Docker version:
Component version/branch: formplayer-UI
Additional Context
The issue occurs because the code checks if keystorePropertiesFile.exists() but doesn't verify that the actual properties are set before using them. When keystoreProperties['FORMULUS_RELEASE_STORE_FILE'] is null, passing it to rootProject.file() causes the build to fail.
Fix Applied:
Changed line 112 in build.gradle from:
if (keystorePropertiesFile.exists()) {to:
if (keystorePropertiesFile.exists() && keystoreProperties['FORMULUS_RELEASE_STORE_FILE']) {This ensures that the release signing configuration is only set up when both the file exists AND the required property is present.