Closed omeryounus closed 4 years ago
I noticed when I place the .APK file then it works fine.
yah, it uses 2 different signing tools based on whether you are signing a .aab
or a .apk
. This looks to be a problem with the jarsigner
utility that is used to sign app bundles. Let me look into this to see what might be going on.
trying running your workflow with this action pointed at the fix/bundle-signing
branch. i.e.
uses: r0adkll/sign-android-release@fix/bundle-signing
This is still falling when using this for bundle.
jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 97517 but got 99407 bytes) Error: The process '/opt/hostedtoolcache/jdk/8.0.275/x64/bin/jarsigner' failed with exit code 1
This is fixed by placing un signed APK file. If there is already a signed version of APK or AAB then it will be failed. However, error message still is not very clear.
Closing...
This still fails for bundleRelease
it worked
@omeryounus could you elaborate how to solve this problem in CI/CD environment? Not sure what "placing un signed APK file" means.
@Onibenjo how did you solve this issue?
Your apk must have been signed with some keystone details
In the signingConfigs section, the release object shouldn't have any signing details
Thanks for the quick response @Onibenjo
In the signingConfig section I removed:
storeFile file('your_key_name.keystore')
Line and the rest what was left is now:
release {
storePassword 'XXX'
keyAlias 'XXX'
keyPassword 'XXX'
}
But now on the build I get an error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file not set for signing config release
Have you tried removing everything in the release section (leaving it blank)?
And also check the release under signingConfigs and under buildTypes
If I remove everyting in the release section I get the following error while building:
Build file '/home/runner/work/WMS-Android-App/WMS-Android-App/android/app/build.gradle' line: 169
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not get unknown property 'release' for SigningConfig container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer.
Under buildtypes I have the following:
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
I am getting the following error when signing the APK.
Run r0adkll/sign-android-release@v1 with: releaseDirectory: app/release signingKeyBase64: alias: keyStorePassword: keyPassword: env: JAVA_HOME_8.0.275_x64: /opt/hostedtoolcache/jdk/8.0.275/x64 JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.275/x64 JAVA_HOME_8_0_275_X64: /opt/hostedtoolcache/jdk/8.0.275/x64 BUILD_TOOLS_VERSION: 30.0.2 Preparing to sign key @ app/release with signing key /opt/hostedtoolcache/jdk/8.0.275/x64/bin/jarsigner -keystore app/release/signingKey.jks -storepass ** -keypass app/release/app-release.aab *** jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 38206 but got 38984 bytes)** Error: The process '/opt/hostedtoolcache/jdk/8.0.275/x64/bin/jarsigner' failed with exit code 1