Closed Callial closed 7 months ago
The alignment is done when we call the "zipalign" tool which is part of the SDK, so the zip install should not make any difference. Are you able to check the zip align boundary for the .apk file that was generated?
You can get tips on checking here https://developer.android.com/tools/zipalign
Ok so I figured it out, it is zipaligning properly, but I mistakenly assumed it was zipaligning both the .apk generated by the command and the apk bundled in the aab. And as such during my testing I was not extracting the .apk from the .aab and instead I was just using the generated .apk When the apk told me that it was not zipaligned, I mistakenly assumed that meant that both apks would not be zipaligned.
tldr: .aab is generated and the internal apk is zipaligned properly, but the .apk generated is the apk before zipaligning
Oh, does this mean we are leaving a temporary file lying around? the .apk output should be created by "fyne package" and the .aab is by "fyne release". A released Android app (.aab) is for upload to Google Play only and should not be tested locally - that is what the package command is for.
It appears to be that way, I only wanted to make sure it worked properly since it was my first time using the command and the last time I attempted to release an android app years ago I struggled with the signing process. Since it gives me both an apk and an aab, I figured it would be fine to test before uploading and that is where I went wrong I guess lol. But yeah I just deleted both files and ran just the release command again and it 100% generates both without deleting the apk after zipaliging and bundling.
It appears to be that way,
I cannot replicate this - when preparing android for release I get a .aab
file and no .apk
left lying around.
Unless you can create specific steps to replicate the issue I think this should be closed.
Checklist
Describe the bug
Using fyne release -os android to build an aab and apk for app store distribution results in an APK that cannot be installed directly or through adb. When installed directly it simply does not finish the install and says app not installed. When installed through adb it gives the following error.
How to reproduce
Screenshots
No response
Example code
Fyne version
2.4.4
Go compiler version
1.22.1
Operating system and version
Windows 11 Home 23H2
Additional Information
I am using a Galaxy S23 Ultra for testing. I used
keytool -genkeypair -v -keystore Test.keystore -alias Test -keyalg RSA -keysize 2048 -validity 10000
to generate the keystore for Testing I only populated the OU with Android to keep things simplezip and unzip installed with chocolatey bundletool setup with a basic bundletool.bat file with the following
development kits for Android and Java installed using Android Studio
The full release command I used for the test environment is
fyne release -os android -appID com.callial.test -appVersion 0.0.1 -appBuild 1 -keyStore Test.keystore -keyStorePass 123456 -keyName Test
I then run
adb install TestAPK.apk
to test it on the phone before the error pops up