Xamarin-android: You uploaded an APK or Android App Bundle with invalid or missing signing information

Created on 5 Dec 2019  路  35Comments  路  Source: xamarin/xamarin-android

Steps to Reproduce

  1. Update Visual Studio to 16.4
  2. Build and package the app as Android App Bundle
  3. Upload the app to Google Play Store

Expected Behavior

Should upload and validate the package successfully.

Actual Behavior

Upload Fail

You uploaded an APK or Android App Bundle with invalid or missing signing information for some of its files. You need to create a valid signed APK or Android App Bundle.

The same package works fine if build with Visual Studio 16.3.x.

If you need the package for analysis, I can share it privately.

Version Information

Microsoft Visual Studio Professional 2019
Version 16.4.0
VisualStudio.16.Release/16.4.0+29519.181
Microsoft .NET Framework
Version 4.8.03761

Installed Version: Professional

Visual C++ 2019 00435-60000-00000-AA853
Microsoft Visual C++ 2019

ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools

ASP.NET and Web Tools 2019 16.4.457.38025
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.4.457.38025
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.4.457.38025
Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.4.1000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.4.457.38025
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.4.1000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 3.4.0-beta4-19569-03+82f2e2541478e239dc4b04f231e90dc2b3dcb422
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure HDInsight Azure Node 2.4.1000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.4.1000.0
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio 16.0
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service 2.4.1000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.21016.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.0.87+gbb515bf382
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.5.23 (1b51e8c)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61911.11100
Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0
Hosting json editor into a tool window

TypeScript Tools 16.0.11031.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.4.0-beta4-19569-03+82f2e2541478e239dc4b04f231e90dc2b3dcb422
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6 16.4.0-beta.19556.5+e7597deb7042710a7142bdccabd6f92b0840d354
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview) 1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes 1.0
Visual Studio Tools for Kubernetes

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Foo 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.4.000.305 (d16-4@a9ec5d9)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.4.0.464 (remotes/origin/d16-4@4abf337c3)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.4.25 (579ee62)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.1.0.30 (d16-4/5e2fd06)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: e1ef774
Java.Interop: xamarin/java.interop/d16-4@c4e569f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.28.0@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK 13.8.2.2 (44c08f2)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

VS bug #1043302

App+Library Build need-info regression vs-sync

Most helpful comment

Thanks everyone for helping me figure out how to repro this!

image

Now I'll figure out what is actually wrong. If your app builds without multi-dex, I would recommend turning if off. You will get faster build times and a slightly faster startup time.

All 35 comments

I just rolled out a dummy test app to alpha that was rebuilt/signed with 16.4, and the play store has accepted it. How are you packaging/signing your .aab? My project file has keystore information set in the Release configuration, so I ran the following:

msbuild /t:Restore,SignAndroidPackage /p:Configuration=Release /p:AndroidPackageFormat=aab foo.csproj

It looks like Google requires you to enable "App Signing by Google Play" in order to publish an App Bundle. Which process did you take when you enabled this signing behavior? Did you generate and upload an encrypted version of your own keystore that you use to sign your app with?

My build script is using the following parameters:

msbuild <csproj> /p:Configuration=Release;AotAssemblies=true;AndroidPackageFormat=aab;AndroidKeyStore=true;AndroidSigningKeyAlias=<alias>;AndroidSigningKeyPass=<keypass>;AndroidSigningKeyStore=<store>;AndroidSigningStorePass=<storepass>;OutputPath=<outputpath> /t:Clean,Build,SignAndroidPackage

App Signing by Google Play is activated. We are using our own key store (upload certificate), which is then signed again by Google with the app certificate, before it is distributed in the Play Store.

@cschwarz one test would be to try an APK (AndroidPackageFormat=apk or use default value). Does Google Play accept the APK in that case?

APK works fine (had to disable AOT because of the 100MB limit).
Also tested AAB without AOT, but it still fails.

I found, after update from VS 16.4 prev to 16.4 sign AAB not works...

https://developercommunity.visualstudio.com/content/problem/844430/vs-2019-164-android-sign.html

I have this problem as well on 16.5.
APK has no issues but google refuses to accept the AAB's due to a signing issue.

I'm not sure what version this problem started in, but I used to be able to use AABs

Would someone be able to share an app bundle that works/doesn't work? We could compare the two.

The app I have appears to be working with 16.4, same as @pjcollins: https://github.com/xamarin/xamarin-android/issues/3993#issuecomment-562269567

I have the same issue, switching from 16.3 to 16.4.
There is also a diskussion at
https://developercommunity.visualstudio.com/content/problem/845978/you-uploaded-an-apk-or-android-app-bundle-with-inv.html

would youl like to have my signed, not working aab, or how can I help you?

I could also provide a signed, not working AAB but it would be of my current production app so I'm not 100% certain if there's any risk involved in sharing that file? (Or a signed and properly working APK if needed).

Unfortunately I don't have an AAB from before it stopped working.

If you're more comfortable sharing in private, email what I have listed on my Github account, thanks!

And just to verify, everyone is building command line, such as above? https://github.com/xamarin/xamarin-android/issues/3993#issuecomment-562282350

The IDE's archive feature is a different code base, so just checking we are looking in the right place.

For clarity I was/am building with VS 16.5 archive feature, not via command line. I've always built that way, including when it worked with AAB's in the past.

I was trying both, command line with 'msbuild.exe -myparam ...' and also with visual studio deploy ad hoc.
Only aab is not working, I tried apk successfully.

Having the same issues, can't upload signed apk bundle. Fails to sign. Upgraded from 16.1 to 16.4. Uploaded and signed the same apk in 16.1, doesn't work in 16.4.

@robatkansys can you file a new issue? This issue is related to App Bundles, not APKs. Other users mentioned that APK works for them: https://github.com/xamarin/xamarin-android/issues/3993#issuecomment-562305133

Can you try setting these in your csproj?

<!--Only try this for an APK!-->
<AndroidApkSigningAlgorithm>md5withRSA</AndroidApkSigningAlgorithm>
<AndroidApkDigestAlgorithm>SHA1</AndroidApkDigestAlgorithm>

If that fixes it, let me know. Thanks!

@jonathanpeppers , sorry still new at all this, may be getting my terminology wrong. Believe i am uploading a bundle. Using Visual Studio Archive Manager, then distributing to google play. When hitting upload it prompts for my keypassword. It comes back saying Xamarin.AndroidTools.AndroidSdkToolException: Failed to load signer "signer #1"
java.io.IOException: Keystore was tampered with, or password was incorrect and then a long java error. Uploaded from 16.1 on 12/2 without a problem.

@robatkansys can you file a new issue? This issue is related to App Bundles, not APKs. Other users mentioned that APK works for them: #3993 (comment)

Can you try setting these in your csproj?

<!--Only try this for an APK!-->
<AndroidApkSigningAlgorithm>md5withRSA</AndroidApkSigningAlgorithm>
<AndroidApkDigestAlgorithm>SHA1</AndroidApkDigestAlgorithm>

If that fixes it, let me know. Thanks!

VS 16.4.1. Same issue - uploading aab doesn't work. With the default signing it returns "invalid or missing signing information". It still builds succefully with the suggested settings above but it just returns "App bundle isn't signed" when uploaded.

Yes, the above settings would be for an APK only, I'll edit the comment.

VS 16.4.1 same issue with aab, apk works fine.

@jonathanpeppers
I think I found the cause. Multi dex, for some reason.

Steps taken to confirm:
Created new project (dummy test with same package name and keystore). Build aab. Upload. Works, no error.
Enabled multi-dex. Clean, rebuild and upload. Doesn't work:
"You uploaded an APK or Android App Bundle with invalid or missing signing information"

@jonathanpeppers
I think I found the cause. Multi dex, for some reason.

Steps taken to confirm:
Created new project (dummy test with same package name and keystore). Build aab. Upload. Works, no error.
Enabled multi-dex. Clean, rebuild and upload. Doesn't work:
"You uploaded an APK or Android App Bundle with invalid or missing signing information"

Works like a charm!! Thanks

I can also confirm that disabling multidex fixed the AAB problem.

Honestly I've had issues disabling multidex in the past so I've not unchecked it recently. My app isn't terribly complicated but I do use a lot of third party libraries so I assumed it was necessary. To my surprise it built and ran fine, though.

Thanks everyone for helping me figure out how to repro this!

image

Now I'll figure out what is actually wrong. If your app builds without multi-dex, I would recommend turning if off. You will get faster build times and a slightly faster startup time.

Same issue here , Visual studio Version 16.4.1. I cannot release the app, the way Ive been doing it the last 2 years.. Multidex is disabled.

Archiving the android app, selecting the "Distribute ..." - "Ad Hoc" and then selecting my signing identity .. inserting password in the box and then I get "Signing packages failed. Failed to load signer "signer #1" java.io.IOException: Keystore was tampered with, or password was incorrect...."

@sh0ckrates , not sure if this will help or not. Have been getting the same "Failed to load signer "signer #1" Keystore was tampered with, or password was incorrect" error since my upgrade to 16.4 last week.

Finally found a fix, the keypassword we had been using has special character in it, even thou is has always worked up until now. We changed the keypassword via the Java jdk using "Javajdk-13.0.1bin> .keytool -keypasswd -alias 'alias here' - keystore key.jks" With the new keypassword I was able to generate a signed apk via adhoc and upload it manually on the play store.

The google play dist functionality still appears to be broken thou because of the outdated api calls.

@robatkansys I think the changes were merged already but there hasn't been a release yet with it fixed

@robatkansys I would never solve it unless u gave me this answer. Thank you very much.

So when will this be released? This causes us to be unable to release new versions of our apps

@PaulVrugt Probably next year. Though if your application builds, then you can just fix the signing manually.

  1. Build aab as usual.
  2. Open aab with 7-Zip.

    • Delete the "META-INF" folder at the root.

    • Navigate to "baserootMETA-INF" and delete all files with the extensions: ".SF", ".MF" or ".RSA".

  3. Resign the aab.
    "%JAVA_HOME%\bin\jarsigner" -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore "your_keystore" "bundle.aab" YourAlias -storepass your_password

I was going to suggest exactly @radimitrov's idea as a workaround: https://github.com/xamarin/xamarin-android/issues/3993#issuecomment-567027495

We are still tied to the VS release schedule, and with the holidays there might not even be a way for us to release something. I will do my best to look into it though, sorry!

Thanks for the suggestions. For now, we have reverted visual studio back to 16.3 to get it working again

I can confirm @radimitrov 's workaround works, with multi-dex enabled as well. @jonathanpeppers not sure if anyone else is seeing this but for me, the archive manager in VS does not show the items during/after archive (but the Xamarin logs in the output window appear). I suspect, but am unsure, that this happened after I changed my Archives Location under Tools -> Options -> Xamarin -> Android Settings, so may be a VS bug with respect to that.

I tried to sign an unsigned aab using jarsigner and .jks and while upload it to play console it is showing the same error as above.

@esspl-git you will also need to delete the extra META-INF directory with a zip utility. The comment here has steps: https://github.com/xamarin/xamarin-android/issues/3993#issuecomment-567027495

I'm working getting the fix for this in a service release. I'll comment if we get one, thanks.

Release status update

A new Release version has now been published that includes the fix for this item.

Fix included in Xamarin.Android 10.1.3.7.

Fix included on Windows in Visual Studio 2019 version 16.4.3. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/.

Fix included on macOS in Visual Studio 2019 for Mac version 8.4.1. To get the new version that includes the fix, check for the latest updates on the Stable updater channel.

Was this page helpful?
0 / 5 - 0 ratings