Jump to content
Sign in to follow this  
Rollo62

Android PlayStore upload failed: Your Android App Bundle has an invalid signature

Recommended Posts

Hi there,

 

I have some issues with the upload of a re-signed AAB bundle.

image.thumb.png.3ebe6ecc0fa03e570d390ee0ad597717.png

 

I have to confess that this is not made with Delphi, for from an external supplier, which I want to Re-Sign into our PlayStore.

This worked well before, but now a new version comes always with the message above: "Your Android App Bundle has an invalid signature"

I only can assume, that this is caused by KeyStore file issues, during signing, but maybe I'm completely wrong with that assumption !!!

 

I have tried many different variants now, different case sensitivity / different version codes / different KeyStore files / and other, but the basic problem with the bundle upload stays the same.


What I try to do and what I am very sure about:

- Downloaded the working AAB package from PlayStore

- Checked the AAB Package, which contains everything as it should
- I want to re-sign this AAB, with the API-level 33 for testing, because I have no never version on-hand soon.

- The original AAB release bundle is currently still working and running in the PlayStore, also for API 32/ API 33 devices
- I used the very same, re-signed and re-bundled AAB Package, which refuses now already to be uploaded into a new internal testing release, see above image
- While I can check that all elements should be correct, like Package-Name, Version, KeyStore fingerprints, KeyStore alias ( tested with various case sensitivity ), and other 

- The Versions numbers were increased correctly, and everything seems well in place, as seen in the code below

- When comparing the KeyStore fingerprints from the PlayStore and re-signed AAB, they were both 1:1 same

 

I have no more idea, how to get this uploaded then, maybe somebody has a clue or spots some issues in the code below.

 

Here were the changes made, to the original package: ( marked by <== HERE: )

element {
  namespace_declaration {
    prefix: "android"
    uri: "http://schemas.android.com/apk/res/android"
    source {
      line_number: 2
    }
  }
  name: "manifest"
  attribute {
    name: "package"
    value: "com.Abcdcef.XyzAppName"    //<== HERE: This is correctly set in final AAB
  }
  attribute {
    namespace_uri: "http://schemas.android.com/apk/res/android"
    name: "versionCode"
    value: "1234"                      //<== HERE: This is correctly set in final AAB
    source {
      line_number: 2
    }
    resource_id: 16843291
    compiled_item {
      prim {
        int_decimal_value: 6
      }
    }
  }
  attribute {
    namespace_uri: "http://schemas.android.com/apk/res/android"
    name: "versionName"
    value: "1.0.66"
    resource_id: 16843292
  }
  attribute {
    namespace_uri: "http://schemas.android.com/apk/res/android"
    name: "compileSdkVersion"
    value: "30"
    source {
      line_number: 2
    }
    resource_id: 16844146
    compiled_item {
      prim {
        int_decimal_value: 30
      }
    }
  }
  attribute {
    namespace_uri: "http://schemas.android.com/apk/res/android"
    name: "compileSdkVersionCodename"
    value: "11"
    resource_id: 16844147
  }
  attribute {
    name: "platformBuildVersionCode"
    value: "1234"                        //<== HERE: This is correctly set in final AAB
    source {
      line_number: 2
    }
    compiled_item {
      prim {
        int_decimal_value: 6
      }
    }
  }
  attribute {
    name: "platformBuildVersionName"
    value: "1.2.34"                       //<== HERE: This is correctly set in final AAB
  }
  child {
    text: "\n\n    "
    source {
      line_number: 5
      column_number: 33
    }
  }
  child {
    element {
      name: "uses-sdk"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "minSdkVersion"
        value: "15"
        source {
          line_number: 7
        }
        resource_id: 16843276
        compiled_item {
          prim {
            int_decimal_value: 15
          }
        }
      }
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "targetSdkVersion"
        value: "33"                        //<== HERE: This is correctly set in final AAB
        source {
          line_number: 7
        }
        resource_id: 16843376
        compiled_item {
          prim {
            int_decimal_value: 30
          }
        }
      }
    }
    source {
      line_number: 7
      column_number: 4
    }
  }
  child {
    text: "\n\n    "
    source {
      line_number: 9
      column_number: 40
    }
  }
  child {
    element {
      name: "uses-permission"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "name"
        value: "android.permission.BLUETOOTH"
        resource_id: 16842755
      }
    }
    source {
      line_number: 11
      column_number: 4
    }
  }
  child {
    text: "\n    "
    source {
      line_number: 11
      column_number: 67
    }
  }
  child {
    element {
      name: "uses-permission"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "name"
        value: "android.permission.BLUETOOTH_ADMIN"
        resource_id: 16842755
      }
    }
    source {
      line_number: 12
      column_number: 4
    }
  }
  child {
    text: "\n    "
    source {
      line_number: 12
      column_number: 73
    }
  }
  child {
    element {
      name: "uses-permission"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "name"
        value: "android.permission.INTERNET"
        resource_id: 16842755
      }
    }
    source {
      line_number: 13
      column_number: 4
    }
  }
  child {
    text: "\n    "
    source {
      line_number: 13
      column_number: 66
    }
  }
  child {
    element {
      name: "uses-permission"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "name"
        value: "android.permission.READ_PHONE_STATE"
        resource_id: 16842755
      }
    }
    source {
      line_number: 14
      column_number: 4
    }
  }
  child {
    text: "\n\n    "
    source {
      line_number: 14
      column_number: 74
    }
  }
  child {
    element {
      name: "uses-permission-sdk-23"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "name"
        value: "android.permission.ACCESS_COARSE_LOCATION"
        resource_id: 16842755
      }
    }
    source {
      line_number: 16
      column_number: 4
    }
  }
  child {
    text: "\n    "
    source {
      line_number: 16
      column_number: 87
    }
  }
  child {
    element {
      name: "uses-permission-sdk-23"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "name"
        value: "android.permission.ACCESS_FINE_LOCATION"
        resource_id: 16842755
      }
    }
    source {
      line_number: 17
      column_number: 4
    }
  }
  child {
    text: "\n\n    "
    source {
      line_number: 17
      column_number: 85
    }
  }
  child {
    element {
      name: "uses-feature"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "name"
        value: "android.hardware.bluetooth_le"
        resource_id: 16842755
      }
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "required"
        value: "true"
        source {
          line_number: 19
        }
        resource_id: 16843406
        compiled_item {
          prim {
            boolean_value: true
          }
        }
      }
    }
    source {
      line_number: 19
      column_number: 4
    }
  }
  child {
    text: "\n\n    "
    source {
      line_number: 21
      column_number: 34
    }
  }
  child {
    element {
      name: "application"
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "allowBackup"
        value: "true"
        source {
          line_number: 23
        }
        resource_id: 16843392
        compiled_item {
          prim {
            boolean_value: true
          }
        }
      }
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "appComponentFactory"
        value: "androidx.core.app.CoreComponentFactory"
        resource_id: 16844154
      }
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "icon"
        value: "@drawable/app_icon"
        source {
          line_number: 23
        }
        resource_id: 16842754
        compiled_item {
          ref {
            id: 2131099732
            name: "drawable/app_icon"
          }
        }
      }
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "label"
        value: "@string/app_name"
        source {
          line_number: 23
        }
        resource_id: 16842753
        compiled_item {
          ref {
            id: 2131427369
            name: "string/app_name"
          }
        }
      }
      attribute {
        namespace_uri: "http://schemas.android.com/apk/res/android"
        name: "theme"
        value: "@style/AppTheme"
        source {
          line_number: 23
        }
        resource_id: 16842752
        compiled_item {
          ref {
            id: 2131492870
            name: "style/AppTheme"
          }
        }
      }
      child {
        text: "\n        "
        source {
          line_number: 28
          column_number: 41
        }
      }
      child {
        element {
          name: "activity"
          attribute {
            namespace_uri: "http://schemas.android.com/apk/res/android"
            name: "label"
            value: "@string/app_name"
            source {
              line_number: 29
            }
            resource_id: 16842753
            compiled_item {
              ref {
                id: 2131427369
                name: "string/app_name"
              }
            }
          }
          attribute {
            namespace_uri: "http://schemas.android.com/apk/res/android"
            name: "name"
            value: "com.Abcdcef.XyzAppName.PSMainActivity"
            resource_id: 16842755
          }
          attribute {
            namespace_uri: "http://schemas.android.com/apk/res/android"
            name: "screenOrientation"
            value: "portrait"
            source {
              line_number: 29
            }
            resource_id: 16842782
            compiled_item {
              prim {
                int_decimal_value: 1
              }
            }
          }
          child {
            text: "\n            "
            source {
              line_number: 32
              column_number: 50
            }
          }
          child {
            element {
              name: "intent-filter"
              child {
                text: "\n                "
                source {
                  line_number: 33
                  column_number: 27
                }
              }
              child {
                element {
                  name: "action"
                  attribute {
                    namespace_uri: "http://schemas.android.com/apk/res/android"
                    name: "name"
                    value: "android.intent.action.MAIN"
                    resource_id: 16842755
                  }
                }
                source {
                  line_number: 34
                  column_number: 16
                }
              }
              child {
                text: "\n\n                "
                source {
                  line_number: 34
                  column_number: 68
                }
              }
              child {
                element {
                  name: "category"
                  attribute {
                    namespace_uri: "http://schemas.android.com/apk/res/android"
                    name: "name"
                    value: "android.intent.category.LAUNCHER"
                    resource_id: 16842755
                  }
                }
                source {
                  line_number: 36
                  column_number: 16
                }
              }
              child {
                text: "\n            "
                source {
                  line_number: 36
                  column_number: 76
                }
              }
            }
            source {
              line_number: 33
              column_number: 12
            }
          }
          child {
            text: "\n        "
            source {
              line_number: 37
              column_number: 28
            }
          }
        }
        source {
          line_number: 29
          column_number: 8
        }
      }
      child {
        text: "\n\n        "
        source {
          line_number: 38
          column_number: 19
        }
      }
      child {
        element {
          name: "service"
          attribute {
            namespace_uri: "http://schemas.android.com/apk/res/android"
            name: "name"
            value: "com.pairlink.normalLib.BLEDeviceManager"
            resource_id: 16842755
          }
        }
        source {
          line_number: 40
          column_number: 8
        }
      }
      child {
        text: "\n    "
        source {
          line_number: 40
          column_number: 74
        }
      }
    }
    source {
      line_number: 23
      column_number: 4
    }
  }
  child {
    text: "\n\n"
    source {
      line_number: 41
      column_number: 18
    }
  }
}
source {
  line_number: 2
}

 

 

Share this post


Link to post

Oh my, like always :classic_blush:

 

A minute after this post, I found the issue:

This problem was caused by an older command-line batch file, which still referred to JarSigner, and not the new ApkSigner, as required since a while.

Quote

APK Signature Scheme v2 now required

Apps that target Android 11 (API level 30) that are currently only signed using APK Signature Scheme v1 must now also be signed using APK Signature Scheme v2 or higher. Users can't install or update apps that are only signed with APK Signature Scheme v1 on devices that run Android 11.

To verify that your app is being signed with APK Signature Scheme v2 or higher, you can use either Android Studio, or the apksigner tool on the command line.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×