There is no valid Keystore when fetching android:hashes

Hi,

I’m having trouble running the commands:
expo fetch:android:hashes
expo fetch:android:upload-cert
expo fetch:android:keystore

The output from the terminal is:

There is no valid Keystore defined for this app
keytool error: java.lang.Exception: Keystore file does not exist: /Users/pjm/Documents/Repositories/Q.83/influencer-app/kitly-app.tmp.jks

keytool exited with non-zero code: 1
Error: keytool exited with non-zero code: 1

This command works fine: expo fetch:ios:certs

I need the android hashes so I can setup Facebook and Google authentication - I believe the issue is similar to the below closed topics:

I’ve tried regenerating my credentials by running:

expo build:android --clear-credentials

This occurs with new projects as well (blank typescript project). The expo init command doesn’t seem to create a keystore for me locally - should this be part of the app creation process?

Expo CLI 3.20.1 environment info:
    System:
      OS: macOS 10.15.3
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 10.16.3 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.1 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.1 AI-173.4670197
      Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
    npmPackages:
      expo: ^36.0.0 => 36.0.2 
      react: 16.9.0 => 16.9.0 
      react-dom: 16.9.0 => 16.9.0 
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4 
      react-native-web: ^0.11.7 => 0.11.7 
    npmGlobalPackages:
      expo-cli: 3.20.1

As a side note - I have tried this on two other computers as well (all Macs)

You can’t regenerate credentials on android in the same way you can on ios. That is why we have scary-looking warning messages, so no one would run it by mistake. You need to use the same keystore you used when uploaded your application the first time, builds with different signature won’t be accepted to play store. After you ran --clear-credentials you removed that keystore from expo servers, did you back it up before doing that?

expo build:android --clear-credentials is clearing keystore immediately, but new one is generated when actual build starts, so if build was still in a queue when you ran this command you might have seen no credentials available

I need the android hashes so I can setup Facebook and Google authentication

If you are using App signing by google play you can’t use those hashes. Play store when uploading apk or aab is striping existing signature and replaces it with a different one, hashes for both of the cases are displayed in the play console in “App singing” tab

Hi wkozyro,
I don’t mind clearing the old credentials because I haven’t uploaded the app to the appstore yet. The issue was that the expo fetch:android:hashes command wasn’t working. Thanks for your advice about using the key from the “App Signing” tab in the Google Play Console - I’ll do that for now and sign the app with the build certificate I get from that page as well.
I’ll just need to work out how to get the Facebook hash.

Hi wkozyro - I’m trying to use the app signing managed by Google Play using this command: expo opt-in-google-play-signing
I get this error though:
Error: PEPK tool failed with return code 1

Where can I get additional details about this error and fixing it? There’s no guides anywhere that I can find that outline how to use expo opt-in-google-play-signing so if you have any information that could help with this then that would be extremely helpful!

I can opt in for Google Play Signing myself using the console so that shouldn’t really be an issue.

I can’t work out how to use the upload certificate downloaded from the console. (i.e: step 3 in the below documentation: App credentials explained - Expo Documentation)

If it’s a new app you shouldn’t run opt-in command.

Note: Unless you submitted your app to the Google Play Store in 2017 or earlier, this probably does not apply to you.

Just run expo build:android, no additional steps are necessary. If you really want to generate keystore before build, you can use expo credentials:manager for that

1 Like

Thanks expo credentials:manager works and I can upload my own Keystore.

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