Recent

Author Topic: [SOLVED] [LAMW] How to sign a Gradle .apk  (Read 4346 times)

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: [LAMW] How to sign a Gradle .apk
« Reply #15 on: January 13, 2021, 07:25:08 am »

Quote
do you know which files are called by the two .bat files to sign the .apk?

Yes! You can open/edit *.bat files using Notepad...

(right-click  --> "Edit"  and by pass the security question....)

Thanks. Probably apksigner.jar needs an update. I'll try reinstalling Java.
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [LAMW] How to sign a Gradle .apk
« Reply #16 on: January 13, 2021, 12:23:52 pm »

My Java 8 64bits  config in picture.....

about  "apksigner":

https://developer.android.com/studio/command-line/apksigner
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: [LAMW] How to sign a Gradle .apk
« Reply #17 on: January 13, 2021, 12:59:47 pm »

My Java 8 64bits  config in picture.....

about  "apksigner":

https://developer.android.com/studio/command-line/apksigner

Attached you can see my Java folder, which was installed automatically by LAMW Manager.

"apksigner sign" is the only part that does not work in the .bat file. In fact, Lazarus is perfectly capable of creating a debug version that can be installed in an Android emulator, and the two unsigned .apk files are created correctly in the release folder.

There must be some problems with release-keystore.bat and/or myappname-release.keystore.
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: [LAMW] How to sign a Gradle .apk
« Reply #18 on: January 13, 2021, 09:33:21 pm »
Out of desperation, I uninstalled and reinstalled LAMW using LAMW Manager. It took me hours.

In the end, I had exactly the same problem: I was unable to sign my unsigned-aligned.apk

Well, Android is not my cup of tea. I'll just give up and look elsewhere.

Thank you anyway for your time.
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [LAMW] How to sign a Gradle .apk
« Reply #19 on: January 13, 2021, 10:42:55 pm »

My Suggestion:

Instal the same (or very close) JAVA that I have in my system and update your
LAMW "Settings Path" and update the java "Enviroment Variable" in your system (JAVA_HOME,  etc...)
if need.... (zulu-8 is an alternative JAVA)
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: [LAMW] How to sign a Gradle .apk
« Reply #20 on: January 14, 2021, 11:34:16 pm »

My Suggestion:

Instal the same (or very close) JAVA that I have in my system and update your
LAMW "Settings Path" and update the java "Enviroment Variable" in your system (JAVA_HOME,  etc...)
if need.... (zulu-8 is an alternative JAVA)

PROBLEM SOLVED!!!

The bug lay inside the file gradle-local-apksigner.bat which I had to amend manually.

In order to solve the problem, I had to express the absolute path of the file myapp-release.keystore (which became C:\LAMWProjects\myapp\myapp-release.keystore.

So I had to change the following line:

Code: Pascal  [Select][+][-]
  1. apksigner sign --ks myapp-release.keystore --ks-pass pass:123456 --key-pass pass:123456 --out C:\LAMWProjects\myapp\build\outputs\apk\release\myapp-release.apk C:\LAMWProjects\myapp\build\outputs\apk\release\myapp-armeabi-v7a-release-unsigned-aligned.apk

into the following line:

Code: Pascal  [Select][+][-]
  1. apksigner sign --ks C:\LAMWProjects\myapp\myapp-release.keystore --ks-pass pass:123456 --key-pass pass:123456 --out C:\LAMWProjects\myapp\build\outputs\apk\release\myapp-release.apk C:\LAMWProjects\myapp\build\outputs\apk\release\myapp-armeabi-v7a-release-unsigned-aligned.apk

Do you think this is a bug that should be fixed in LAMW?

Thanks
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [LAMW] How to sign a Gradle .apk
« Reply #21 on: January 15, 2021, 03:12:04 am »

alive! congratulations!

Quote
Do you think this is a bug that should be fixed in LAMW?

Yes! I will apply that! 

Thank you!

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: [LAMW] How to sign a Gradle .apk
« Reply #22 on: January 15, 2021, 07:09:16 am »

alive! congratulations!

Quote
Do you think this is a bug that should be fixed in LAMW?

Yes! I will apply that! 

Thank you!

Please let me know when the fix is ready, so I can update LAMW on my PC.

Thanks.
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [LAMW] How to sign a Gradle .apk
« Reply #23 on: January 15, 2021, 01:51:18 pm »

Done!

Fixed "androidwizard_intf.pas"    [folder  .....\android_wizard]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: [LAMW] How to sign a Gradle .apk
« Reply #24 on: January 15, 2021, 02:15:21 pm »

Done!

Fixed "androidwizard_intf.pas"    [folder  .....\android_wizard]

Nope. Your update does not create the release .apk. I still have to intervene manually.

In fact, the resultig .bat file does not contain the absolute path of the keystore:

Quote
apksigner sign --ks applamwproject1-release.keystore --ks-pass pass:123456 --key-pass pass:123456 --out C:\LAMWProjects\AppLAMWProject1\build\outputs\apk\release\AppLAMWProject1-release.apk C:\LAMWProjects\AppLAMWProject1\build\outputs\apk\release\AppLAMWProject1-armeabi-v7a-release-unsigned-aligned.apk
« Last Edit: January 15, 2021, 06:20:19 pm by pasquale »
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [LAMW] How to sign a Gradle .apk
« Reply #25 on: January 15, 2021, 03:03:39 pm »

My Test:

Quote
apksigner sign --ks C:\android\workspace\AppLAMWProject10\applamwproject10-release.keystore --ks-pass pass:123456 --key-pass pass:123456 --out
C:\android\workspace\AppLAMWProject10\build\outputs\apk\release\AppLAMWProject10-release.apk
C:\android\workspace\AppLAMWProject10\build\outputs\apk\release\AppLAMWProject10-armeabi-v7a-release-unsigned-aligned.apk

You need re-install the package "lazandroidwizardpack.lpk"    [folder "............\android_wizard"]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

pasquale

  • Sr. Member
  • ****
  • Posts: 267
    • Esposito Software
Re: [LAMW] How to sign a Gradle .apk [SOLVED]
« Reply #26 on: January 15, 2021, 03:34:26 pm »

My Test:

Quote
apksigner sign --ks C:\android\workspace\AppLAMWProject10\applamwproject10-release.keystore --ks-pass pass:123456 --key-pass pass:123456 --out
C:\android\workspace\AppLAMWProject10\build\outputs\apk\release\AppLAMWProject10-release.apk
C:\android\workspace\AppLAMWProject10\build\outputs\apk\release\AppLAMWProject10-armeabi-v7a-release-unsigned-aligned.apk

You need re-install the package "lazandroidwizardpack.lpk"    [folder "............\android_wizard"]

Yes! Now it works!

I created a new app and this time the release .apk was compiled correctly (see attached file).

You did a very good job. Congratulations!

Thank you very much.

Keep up the good work!
« Last Edit: January 15, 2021, 03:40:39 pm by pasquale »
Apple loves breaking backward compatibility to make money. If you want to be sure that your apps will never stop working, use Windows and trash macOS!

rsu333

  • Full Member
  • ***
  • Posts: 110
Re: [SOLVED] [LAMW] How to sign a Gradle .apk
« Reply #27 on: January 16, 2021, 05:47:42 am »
This is useful information. Mostly play store ask many thing like key, release apk etc and not accept apk in  usually made other than Android store. [I experience so]

 

TinyPortal © 2005-2018