-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Xamarin.Android.Build.Tasks] App Bundles & Google Play #3146
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Redth and I recently went through the process of submitting a Xamarin.Android App Bundle to Google Play. He had an existing app, while I tested the SmartHotel360 app. Unfortunately, Google Play did not accept the bundle at first: "The Android App Bundle was not signed." But it *was* signed? Looking at the build log, the build was running: jarsigner.exe -keystore foo.keystore -storepass foo -keypass foo -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Release\com.foo.smarthotel-Signed.aab obj\Release\90\android\bin\com.foo.smarthotel.aab For Android App Bundles, Google Play seems to no longer allow md5 or SHA1 in favor of SHA-256. For App Bundles to be accepted by Google Play, we had to run `jarsigner` manually with: jarsigner.exe -keystore foo.keystore -storepass foo -keypass foo -digestalg SHA-256 -sigalg SHA256withRSA -signedjar bin\Release\com.foo.smarthotel-Signed.aab obj\Release\90\android\bin\com.foo.smarthotel.aab To fix our MSBuild targets: * `$(AndroidApkSigningAlgorithm)` now has default values to support both `.apk` and `.aab` files * A new `$(AndroidApkDigestAlgorithm)` property was added with respective default values This will give developers flexibility if these values need to be changed from a `.csproj` in the future. After this change, I was able to produce an App Bundle Google Play will accept with: msbuild foo.android.csproj /t:SignAndroidPackage /p:Configuration=Release /p:AndroidPackageFormat=aab I also had the following properties configured in the `.csproj`: <AndroidKeyStore>True</AndroidKeyStore> <AndroidSigningKeyStore>foo.keystore</AndroidSigningKeyStore> <AndroidSigningStorePass>foo</AndroidSigningStorePass> <AndroidSigningKeyAlias>foo</AndroidSigningKeyAlias> <AndroidSigningKeyPass>foo</AndroidSigningKeyPass> `foo.keystore` I created by using the command from this doc: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/signing/manually-signing-the-apk ~~ Results ~~ @Redth's app had some good size improvements: * APK: 39.4MB * Android App Bundle: 23.3MB to 25.4MB ~35% savings!
Closed
The failure I see on macOS:
I don't think this PR would cause that, and we can ignore it. These tests run on the deskop, changes to jarsigner couldn't affect it? |
Correct, changes to Additionally, |
jonpryor
pushed a commit
that referenced
this pull request
May 31, 2019
@Redth and I recently went through the process of submitting a Xamarin.Android App Bundle to Google Play. He had an existing app, while I tested the SmartHotel360 app. Unfortunately, Google Play did not accept the bundle at first: > The Android App Bundle was not signed. But it *was* signed? Looking at the build log, the build was running: jarsigner.exe ^ -keystore foo.keystore ^ -storepass foo ^ -keypass foo ^ -digestalg SHA1 ^ -sigalg md5withRSA ^ -signedjar bin\Release\com.foo.smarthotel-Signed.aab ^ obj\Release\90\android\bin\com.foo.smarthotel.aab For Android App Bundles, Google Play seems to no longer allow md5 or SHA1 in favor of SHA-256. For App Bundles to be accepted by Google Play, we had to run `jarsigner` manually with: jarsigner.exe ^ -keystore foo.keystore ^ -storepass foo ^ -keypass foo ^ -digestalg SHA-256 ^ -sigalg SHA256withRSA ^ -signedjar bin\Release\com.foo.smarthotel-Signed.aab ^ obj\Release\90\android\bin\com.foo.smarthotel.aab To fix our MSBuild targets: * `$(AndroidApkSigningAlgorithm)` now has default values to support both `.apk` and `.aab` files * A new `$(AndroidApkDigestAlgorithm)` property was added with respective default values This will give developers flexibility if these values need to be changed from a `.csproj` in the future. After this change, I was able to produce an App Bundle Google Play will accept with: msbuild foo.android.csproj /t:SignAndroidPackage /p:Configuration=Release /p:AndroidPackageFormat=aab I also had the following properties configured in the `.csproj`: <AndroidKeyStore>True</AndroidKeyStore> <AndroidSigningKeyStore>foo.keystore</AndroidSigningKeyStore> <AndroidSigningStorePass>foo</AndroidSigningStorePass> <AndroidSigningKeyAlias>foo</AndroidSigningKeyAlias> <AndroidSigningKeyPass>foo</AndroidSigningKeyPass> `foo.keystore` I created by using the command from this doc: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/signing/manually-signing-the-apk ~~ Results ~~ @Redth's app had some good size improvements: * APK: 39.4MB * Android App Bundle: 23.3MB to 25.4MB A ~35% savings by using App Bundles!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@Redth and I recently went through the process of submitting a
Xamarin.Android App Bundle to Google Play. He had an existing app,
while I tested the SmartHotel360 app.
Unfortunately, Google Play did not accept the bundle at first:
But it was signed?
Looking at the build log, the build was running:
For Android App Bundles, Google Play seems to no longer allow md5 or
SHA1 in favor of SHA-256.
For App Bundles to be accepted by Google Play, we had to run
jarsigner
manually with:To fix our MSBuild targets:
$(AndroidApkSigningAlgorithm)
now has default values to supportboth
.apk
and.aab
files$(AndroidApkDigestAlgorithm)
property was added withrespective default values
This will give developers flexibility if these values need to be
changed from a
.csproj
in the future.After this change, I was able to produce an App Bundle Google Play
will accept with:
I also had the following properties configured in the
.csproj
:foo.keystore
I created by using the command from this doc:https://docs.microsoft.com/en-us/xamarin/android/deploy-test/signing/manually-signing-the-apk
Results
@Redth's app had some good size improvements:
~35% savings!