./gradlew bundleRelease not working with -P in React Native 0.60.5
See original GitHub issueHi there!
On React Native 0.60.5 the ./gradlew bundleRelease command has stopped working when signing config properties are provided wit the -P flag.
Without -P:
➜ android ./gradlew bundleRelease
> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, /Users/lydiagolland/Projects/tets/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /Users/lydiagolland/Projects/tets/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 2 asset files
info Done copying assets
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1m 0s
33 actionable tasks: 33 executed
With -P
➜ android ./gradlew bundleRelease -Pandroid.injected.signing.store.file='debug.keystore' -Pandroid.injected.signing.store.password='android' -Pandroid.injected.signing.key.alias='androiddebugkey' -Pandroid.injected.signing.key.password='android'
> Task :app:validateSigningRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file '/Users/lydiagolland/Projects/tets/android/debug.keystore' not found for signing config 'externalOverride'.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
React Native version:
System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 523.11 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
Yarn: 1.17.3 - ~/.nvm/versions/node/v12.6.0/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v12.6.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 23, 28, 29
Build Tools: 28.0.2, 28.0.3, 29.0.1
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
react-native-cli: 2.0.1
Steps To Reproduce
react-native init- Comment out
signingConfig signingConfigs.debugfrom release buildType cd android && ./gradlew bundleRelease -Pandroid.injected.signing.store.file='app/debug.keystore' -Pandroid.injected.signing.store.password='android' -Pandroid.injected.signing.key.alias='androiddebugkey' -Pandroid.injected.signing.key.password='android'
Describe what you expected to happen:
It to build successfully as it does with ./gradlew bundleRelease when signing config is provided in the build gradle.
Fastlane uses the -P flag in its build_android lane and so this is currently preventing people from being able to automatically handle signing in fastlane for android builds.
Thanks in advance for any help!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11
Top Results From Across the Web
2 Answers - 2 - Stack Overflow
gradlew assembleRelease -x bundleReleaseJsAndAssets. if this fails: in root of project: react-native bundle --platform android --dev false -- ...
Read more >Test Renderer - React
This package provides a React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM...
Read more >React Native - Sentry Documentation
Sentry's React Native SDK enables automatic reporting of errors and exceptions, and identifies performance issues in your application. The React Native SDK ...
Read more >Configure multiple flavor/schema for React Native Apps
So, We will divide this tutorial in two parts Android and iOS. Android. Note: Once you add Product Flavors to your app, you...
Read more >Getting Started with React Native on Android | Pluralsight
Note : Homebrew installation requires the xcode-select command-line tool to work so it's recommended to install Xcode as well or it will ask...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @anmol-appzoy. Not sure the link you put in is correct as it leads to a totally different issue? As for my current solution to this issue.
In my app/build.gradle
Then in before I run
./gradlew bundleReleaseI set the three variables MYAPP_RELEASE_STORE_PASSWORD, MYAPP_RELEASE_KEY_ALIAS and MYAPP_RELEASE_KEY_PASSWORD in my gradle.properties file. Locally I just copy paste them in as needed and when running in ci I have them set as secret environment variables and simply echo them into my gradle.properties file before I build.You can still run fastlane lane but just with this:
Hope this helps!
@Asleepace Yeah
./gradlew assembleBundleand./gradlew assembleReleaseboth work for me, it only fails when I use the-Pflag to pass in the signing properties. We use fastlane to build our android app in CI and fastlane uses the-Pflag behind the scenes in its build_android_app lane so, although we are not blocked from building our app entirely, we are blocked from using fastlane in the most straightforward way.