-1

I have tried generating new key using keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000. Copied it to android/app/ and ~/.android/. It keeps complaining. When I run ./gradlew signingReport it is fine.

In my build.gradle I have

signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

My fastlane fastfile

desc "Submit a new build to Play Store 'Testing' track"
  lane :testingtrack do
    # gradle(task: 'assemble', build_type: 'Release')
    gradle(
      task: "bundle",
      build_type: "Release",
      print_command: false,
    )
    increment_version_code(
      gradle_file_path: "app/build.gradle",
    )
    upload_to_play_store(track: 'Testing', skip_upload_apk: true)
    # slack(message: 'Successfully distributed a new beta build')
  end  

I am trying to upload a beta app, it worked once before but I recloned my repo and did not save the old key. I have also tried to generate new signing key using Android Studio which fails with different error, "cannot read the file". I also tried to download the upload key off play store which does not work as well.

shorif2000
  • 2,582
  • 12
  • 65
  • 137

2 Answers2

0

Without your previous debug key, you can't fix this.

Your last uploaded app was apparently signed with the debug key which was automatically created by Android Studio. A debug keystore is however still a valid keystore which you can use for release.

Once you upload an app to the Play Store in any of the release or test tracks (production, beta, alpha, internal) you are locked in. You can then only update the app if you use the exact same signing key again.

Alexander Hoffmann
  • 5,104
  • 3
  • 17
  • 23
0

https://support.google.com/googleplay/android-developer/answer/9842756?hl=en-GB

Lost or compromised upload key?

If you’ve lost your private upload key or it’s been compromised, you can create a new one, and then ask your account owner to contact support to reset the key. When contacting support, make sure that your account owner attaches the upload_certificate.pem file.

After our support team registers the new upload key, you will receive an email, and then you can update your keystores and register your key with API providers.

Important: Resetting your upload key doesn’t affect the app signing key that Google Play uses to re-sign APKs before delivering them to users.

Yuri Schimke
  • 12,435
  • 3
  • 35
  • 69