Getting error when trying to build android

The following is already set in the environment:

EXPO_ANDROID_KEYSTORE_FILE=/path/to/keystore.jks
EXPO_ANDROID_KEYSTORE_ALIAS=“alias”
EXPO_ANDROID_KEY_PASSWORD=“password”
EXPO_ANDROID_KEYSTORE_PASSWORD=“password”

This is the command that I have executed locally:

expo build:android --non-interactive --release-channel build-33 --keystore-path=$EXPO_ANDROID_KEYSTORE_FILE --keystore-alias=$EXPO_ANDROID_KEYSTORE_ALIAS

Hitting this error:

[11:34:10] Checking if there is a build in progress...

[11:34:10] Accessing credentials for kratoskp in project easysocial
[11:34:18] An unknown error occurred.

Environment:

Expo CLI 3.28.2 environment info:
System:
OS: macOS 10.15.7
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
npmPackages:
expo: ^39.0.0 => 39.0.3
react: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz => 0.63.2
react-navigation: ^4.4.0 => 4.4.2
npmGlobalPackages:
expo-cli: 3.28.2
Expo Workflow: managed

Seems like there’s a problem when uploading the keystore through the credentials manager and hitting this error:

ApiV2Error: An unknown error occurred.
at ApiV2Client._requestAsync (/@expo/xdl@58.0.16/src/ApiV2.ts:245:21)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at ApiClient.updateKeystoreApi (/usr/local/lib/node_modules/expo-cli/src/credentials/api/AndroidApiV2Wrapper.ts:19:12)
at AndroidApi.updateKeystore (/usr/local/lib/node_modules/expo-cli/src/credentials/api/AndroidApi.ts:36:5)
at UpdateKeystore.open (/usr/local/lib/node_modules/expo-cli/src/credentials/views/AndroidKeystore.ts:46:5)
at CredentialsManager.run (/usr/local/lib/node_modules/expo-cli/src/credentials/route.ts:41:12)
at runCredentialsManagerStandalone (/usr/local/lib/node_modules/expo-cli/src/credentials/route.ts:7:3)
at program.command.description.helpGroup.option.asyncActionProjectDir.checkConfig (/usr/local/lib/node_modules/expo-cli/src/commands/credentials.ts:37:9)
at Command. (/usr/local/lib/node_modules/expo-cli/src/exp.ts:332:7) {
code: ‘INTERNAL_SERVER_ERROR’,
details: undefined,
serverStack: undefined,
metadata: undefined,
_isApiError: true
}

hey @kratoskp,

i took at look at the server logs and we are not able to parse the keystore you are trying to upload. Specifically, we cannot find the certificate under the keystore alias you provided. Would you be able to help me debug by looking at the output of: keytool -list -v -keystore [your-keystore-path]?

In the meantime, I’m going to add a fix to the server so that it’ll give you back a helpful error instead of just INTERNAL_SERVER_ERROR.

1 Like

Hi @quinlanj,

this is the output when I ran keytool -list -v -keystore [your-keystore-path]

Keystore type: PKCS12
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: easysocial
Creation date: 15 Jan 2020
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Stackideas Sdn. Bhd., OU=Development, O=StackIdeas, C=US
Issuer: CN=Stackideas Sdn. Bhd., OU=Development, O=StackIdeas, C=US
Serial number: 20e3b70e
Valid from: Wed Jan 15 11:08:08 MYT 2020 until: Thu Oct 18 11:08:08 MYT 2074
Certificate fingerprints:
	 SHA1: 5A:EB:57:39:74:5F:E0:A9:A9:9A:41:40:62:F6:43:ED:EA:55:CE:9A
	 SHA256: 77:99:7A:FE:34:62:94:C4:10:C2:70:F9:A1:C9:C0:B4:04:C4:24:6A:5A:16:09:12:18:A5:F1:AE:41:C3:00:62
Signature algorithm name: SHA256withDSA
Subject Public Key Algorithm: 2048-bit DSA key
Version: 3

Extensions: 

#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: D7 35 31 7A 41 2A D9 D8   99 7C 62 C9 C1 56 7D 80  .51zA*....b..V..
0010: E7 5A 35 80                                        .Z5.
]
]



*******************************************
*******************************************

Btw, the server still return the error INTERNAL_SERVER_ERROR when I try to upload existing keystore.

But the weird thing is, when I generate a new keystore. I’m able to upload it even though I created the new keystore with the same properties as the new existing one.

@kratoskp oh wow ok. What’s the output when you run keytool -list -v -keystore on the new keystore? Is the Signature algorithm name still SHA256withDSA? :open_mouth:

@quinlanj Seems like the new keystore is using Signature algorithm name: SHA256withRSA

@quinlanj I have updated my expo cli to version 3.28.4, retry to upload my old keystore and ther server gave out an actual error log this time. This is the result return by the server:

ApiV2Error: Invalid PKCS#12 (.p12) keystore: PKCS12: bag is not a certificate.
    at ApiV2Client._requestAsync (/@expo/xdl@58.0.18/src/ApiV2.ts:245:21)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at ApiClient.updateKeystoreApi (/usr/local/lib/node_modules/expo-cli/src/credentials/api/AndroidApiV2Wrapper.ts:19:12)
    at AndroidApi.updateKeystore (/usr/local/lib/node_modules/expo-cli/src/credentials/api/AndroidApi.ts:36:5)
    at UpdateKeystore.open (/usr/local/lib/node_modules/expo-cli/src/credentials/views/AndroidKeystore.ts:46:5)
    at CredentialsManager.run (/usr/local/lib/node_modules/expo-cli/src/credentials/route.ts:41:12)
    at runCredentialsManagerStandalone (/usr/local/lib/node_modules/expo-cli/src/credentials/route.ts:7:3)
    at program.command.description.helpGroup.option.asyncActionProjectDir.checkConfig (/usr/local/lib/node_modules/expo-cli/src/commands/credentials.ts:37:9)
    at Command.<anonymous> (/usr/local/lib/node_modules/expo-cli/src/exp.ts:332:7) {
  code: 'CREDENTIALS_ANDROID_KEYSTORE_ERROR',
  details: undefined,
  serverStack: undefined,
  metadata: undefined,
  _isApiError: true
}

Note: This keystore is currently being use to upload app into the playstore. So I can’t afford to use other keystore I’m afraid. I’ve double check if i entered the wrong password and alias also

hey @kratoskp , let’s move the conversation to Android Keystore: error parsing PKCS#12 with DSA encrypted certificate · Issue #2845 · expo/expo-cli · GitHub . I recently deployed changes to the server that gives you more context about the problem a couple hours ago, which is why you are seeing the new error now.

I’m currently seeing what needs to be done to fix the root cause, but will also work on a fix that will unblock you sooner. It will likely take a couple days.

changes are deployed, @kratoskp can u try building again pls

1 Like

Im able to upload my existing Keystore to the server. so the initial issue Im facing is resolve. But when I try to build. It failed without any logs. Already create an issue here for this issue. Android builds with PKCS#12 keystores failing · Issue #276 · expo/turtle · GitHub

@kratoskp i’ve deployed a fix for Android builds with PKCS#12 keystores failing · Issue #276 · expo/turtle · GitHub , could u pls confirm it works for you? thanks!

I was facing same issue here due my keystore PKCS12 and everything seems fine now. Thanks for your support.

Built successfully! Thanks @quinlanj

Thank you @quinlanj!!! Here my app was builded with success!!!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.