5

I've setup ci/cd using Microsoft App Center. It works with debug APK perfectly, but while building release APK I am getting error. The certificate was uploaded and everything is set up correctly in the app. No such problem, when I'm trying to build it, using npm command:
"android-release": "cd android && ./gradlew assembleRelease"

What can be the problem?

> Task :app:validateSigningRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> 
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
Keystore file '/Users/vsts/agent/2.150.0/work/1/s/android/app/my-release-key.keystore' not found for signing config 'release'.

* 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

BUILD FAILED in 1m 34s
22 actionable tasks: 21 executed, 1 up-to-date
Error: /Users/vsts/agent/2.150.0/work/1/s/android/gradlew failed with return code: 1
    at ChildProcess.<anonymous> (/Users/vsts/agent/2.150.0/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/1.128.0/node_modules/vsts-task-lib/toolrunner.js:569:30)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
##[error]Error: /Users/vsts/agent/2.150.0/work/1/s/android/gradlew failed with return code: 1
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
##[section]Finishing: Gradle Task
##[section]Starting: Checkout

2 Answers 2

14

If you focus on this line of error:

Keystore file '/Users/vsts/agent/2.150.0/work/1/s/android/app/my-release-key.keystore' not found for signing config 'release'.

It is saying that keystore not found so verify it exists in suitable location which is inside android/app directory and also verify you have added

MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****

inside your android/gradle.properties file.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot! Keystore file was in .gitignore by default, so App Center didn't see it.
0

First of all you have to create my-release-key.keystore file for your release build. please follow this official link to generate signed apk.

Generate signed apk react-native

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.