lugg / react-native-config

Bring some 12 factor love to your mobile apps!
MIT License
4.76k stars 652 forks source link

SigningConfig "releaseStaging" is missing required property "storePassword" when using gradlew to build #768

Open aminta opened 10 months ago

aminta commented 10 months ago
   "react-native": "0.71.6",
   "react-native-config": "^1.5.1",

build.gradle:

  signingConfigs {
        debug {
            storeFile file('keystore/debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
        releaseProduction {
            storeFile file('keystore/releaseProduction.keystore')
            storePassword project.env.get("ANDROID_STORE_PASSWORD")
            keyAlias project.env.get("ANDROID_STORE_RELEASE_KEY")
            keyPassword project.env.get("ANDROID_KEY_PASSWORD")
        }
        releaseStaging {
            storeFile file('keystore/releaseStaging.keystore')
            storePassword project.env.get("ANDROID_STORE_PASSWORD")
            keyAlias project.env.get("ANDROID_STORE_RELEASE_KEY")
            keyPassword project.env.get("ANDROID_KEY_PASSWORD")
        }
    }

[...]

project.ext.envConfigFiles = [
        productiondebug: ".env.prod",
        productionrelease: ".env.prod",
        stagingrelease: ".env.staging",
        stagingdebug: ".env.staging"
]

I launch ./gradlew assembleStagingRelease

And i get:

> Configure project :app
Reading env from: .env
**************************
*** Missing .env file ****
**************************
Reading env from: .env.staging

[...]

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageStagingRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > SigningConfig "releaseStaging" is missing required property "storePassword".

If i use the UI to build ("Build" => "Generate signed bundle APK") it perfectly works.

Why?

cjadhav commented 1 month ago

Hi @aminta,

I am getting same error. Did you find any workround to fix it.?

Thanks