Skip to content
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

[Bug]: npx cap build not building signed apk with --signing-type apksigner #7366

Closed
1 of 3 tasks
tiga05 opened this issue Mar 23, 2024 · 2 comments
Closed
1 of 3 tasks
Labels

Comments

@tiga05
Copy link

tiga05 commented Mar 23, 2024

Capacitor Version

Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 5.7.4
@capacitor/core: 5.7.4
@capacitor/android: 5.7.4
@capacitor/ios: 5.7.4

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/cli: 5.7.4
@capacitor/core: 5.7.4
@capacitor/android: 5.7.4

Other API Details

npm-version: 10.2.4
Node-Version: 20.11.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

I have already created a bug report regarding a similiar issue here: #7054
In this issue it was not possible to use the command --signing-type apksigner at all to generate an apk-file. Thanks to @bentleyo it was fixed via PR later here: #7073

I was about to update my pipeline and wanted to switch over to this fixed command. The command is now working but revealed the next issue: it actually says the signed apk was created but it is not. It only creates the unsigned apk, see the content in the release folder:

C:\build\capBug [main ≡ +1 ~2 -0 !]> npx cap build android --keystorepath ../MultiKey.jks --keystorepass keyStorePW --keystorealias key0 --keystorealiaspass key0PW --signing-type apksigner --androidreleasetype APK
√ Running Gradle build in 1.80s
√ Signing Release in 43.12ms
[success] Successfully generated app-release-signed.apk at: C:\build\capBug\android\app\build\outputs\apk\release
C:\build\capBug [main ≡ +1 ~2 -0 !]> cd C:\build\capBug\android\app\build\outputs\apk\release
C:\build\capBug\android\app\build\outputs\apk\release [main ≡ +1 ~2 -0 !]> ls

Verzeichnis: C:\build\capBug\android\app\build\outputs\apk\release

Mode LastWriteTime Length Name


-a---- 22.03.2024 23:47 3049061 app-release-unsigned.apk
-a---- 22.03.2024 23:48 379 output-metadata.json

C:\build\capBug\android\app\build\outputs\apk\release [main ≡ +1 ~2 -0 !]>

To reproduce the issue:

  • clone my example repo: https://github.com/tiga05/capBug.git
  • npm install
  • use build command:
    npx cap build android --keystorepath ../MultiKey.jks --keystorepass keyStorePW --keystorealias key0 --keystorealiaspass key0PW --signing-type apksigner --androidreleasetype APK
    --> result: only unsigned apk gets generated

Expected Behavior

Having a app-release-signed.apk besides the app-release-unsigned.apk file

Project Reproduction

https://github.com/tiga05/capBug

Additional Information

No response

@tiga05 tiga05 added the triage label Mar 23, 2024
@jcesarmobile
Copy link
Member

Closing as duplicate of #7299

#7073 had a mistake and didn't fix the issue, also the fix was only applied to Capacitor 6, so updating to latest Capacitor 5 won't solve your issue anyway.
In your sample app I still get the same error as on your previous issue, not sure why it says signing was a success in your log messages.

Copy link

ionitron-bot bot commented Apr 24, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants