androidandroid-studioandroid-keystore

"Missing keystore" in Android Studio Debug mode although there is a debug.keystore in the ".android" folder


Greetings to everyone,

I'm trying to make some tests to use App Links on my app, but I've encountered an issue regarding the debug.keystore during my tests. Because of this, I've being unable to run the App Links test to check the assetlinks.json file on my server.

When I try to run Gradle > Tasks > android > signingReport on Android Studio I get the error "Missing keystore", upon further investigation, I've found that I do have a debug.keystore located on my "C:\Users\xavie\.android" folder. "Missing keystore" error

I've already done a couple of troubleshooting:

  1. Invalidate caches
  2. Clean project and then rebuild project.
  3. Make project
  4. Doing a clean install of Android Studio.
  5. Setting the debug.keystore path on build.gradle. build.gradle signingConfigs
  6. Tried to load the project on my Debian machine and my Mac mini (the same error arises)
  7. Checked if my project is set to debug as the default Build Variant, which is already set as the default.
  8. Tried to regenerate the debug.keystore as JKS instead of PKCS12
  9. Besides defining in build.gradle, I've also checked on File > Project Structure > Modules > Signing Configs if it is set to the right path
  10. Deleted my old debug.keystore and generated a new one using on my .android folder:
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 -storepass android -keypass android

To check if it is something related to my project, I created a new project from scratch, this new project seems to be able to find the debug.keystore just fine. So, I'm inclined to believe that the problem is with my current project, but I've been unable to find the root of the problem.

I've never encountered this issue before, and after trying a lot of things, I'm completely clueless of what it might be.

The release keystore works fine.


Solution

  • To fix this problem, simply locate file stored in one of the following locations:

    The next time you build and run a debug version of your app, Android Studio regenerates a new keystore and debug key.

    Then keystore.properties in the root directory of your project. This file should contain your signing information, as follows:

    storePassword=myStorePassword
    keyPassword=mykeyPassword
    keyAlias=myKeyAlias
    storeFile=myStoreFileLocation
    

    Eg; myStoreFileLocation, ~/user/keystores/upload-keystore.jks

    Reference: https://developer.android.com/studio/publish/app-signing

    NOTE: Generated keystore file this way should be automatically detected with your configuration.