使用LAMW发现不能生成带签名APK,经跟踪发现LAMW生成的release-keystore.bat在keytool前有LC_ALL=C造成不法生成.keystore 文件,删除后就能正常生成keystore文件和带签名的APK。更新:向官方反馈后2021.1.6已修复此问题
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60 set PATH=%JAVA_HOME%\bin;%PATH% set JAVA_TOOL_OPTIONS=-Duser.language=en cd D:\fpcupdeluxe3\projects\LAMWProjects\AppLAMWProject6 LC_ALL=C keytool -genkey -v -keystore applamwproject6-release.keystore -alias applamwproject6.keyalias -keyalg RSA -keysize 2048 -validity 10000 < D:\fpcupdeluxe3\projects\LAMWProjects\AppLAMWProject6\keytool_input.txt :Error echo off cls echo. echo Signature file created previously, remember that if you delete this file and it was uploaded to Google Play, you will not be able to upload another app without this signature. echo. pause
release-keystore.bat这个文件是新建APK时自动生成的,只需将lamw\android_wizard\AndroidWizard_intf.pas第2219行的LC_ALL=C删除,然后重新编译lazarus就可以。
修改为:
重新编译的lazarus在新建安卓项目工程时生成正确的release-keystore.bat,不用每次新建项目时都要修改release-keystore.bat。