how to build apk file with android sdk 19 and next version with laz4android? lazarus / 43-Android ---------------------------------------------------------------------- greenzyzyzy · 2015-05-08 13:41 how to build apk file with android sdk 19(not ndk) and next version with laz4android? i only sucessful build the apk file with sdk 15 and below,sdk 19 and next always error. where is wrong? ---------------------------------------------------------------------- greenzyzyzy · 2015-05-09 02:08 Quote from: greenzyzyzy on May 08, 2015, 03:41:53 pmhow to build apk file with android sdk 19(not ndk) and next version with laz4android? i only sucessful build the apk file with sdk 15 and below,sdk 19 and next always error. where is wrong? no body likes to help me? ---------------------------------------------------------------------- BitBangerUSA · 2015-05-09 02:14 you likely should give some info about the errors. guessing is unproductive. ---------------------------------------------------------------------- greenzyzyzy · 2015-05-09 04:03 Quote from: greenzyzyzy on May 09, 2015, 04:08:22 amQuote from: greenzyzyzy on May 08, 2015, 03:41:53 pmhow to build apk file with android sdk 19(not ndk) and next version with laz4android? i only sucessful build the apk file with sdk 15 and below,sdk 19 and next always error. where is wrong? no body likes to help me? felipemdc and Leledumbo two gods will you likes to help me? ---------------------------------------------------------------------- Leledumbo · 2015-05-09 08:32 Quote from: greenzyzyzy on May 09, 2015, 06:03:23 amQuote from: greenzyzyzy on May 09, 2015, 04:08:22 amQuote from: greenzyzyzy on May 08, 2015, 03:41:53 pmhow to build apk file with android sdk 19(not ndk) and next version with laz4android? i only sucessful build the apk file with sdk 15 and below,sdk 19 and next always error. where is wrong? no body likes to help me? felipemdc and Leledumbo two gods will you likes to help me? Do what @BitBangerUSA says. A good way to ask is documented in the wiki and in my comments' signature. Otherwise, no help. ---------------------------------------------------------------------- greenzyzyzy · 2015-05-09 09:43 Quote from: Leledumbo on May 09, 2015, 10:32:12 amQuote from: greenzyzyzy on May 09, 2015, 06:03:23 amQuote from: greenzyzyzy on May 09, 2015, 04:08:22 amQuote from: greenzyzyzy on May 08, 2015, 03:41:53 pmhow to build apk file with android sdk 19(not ndk) and next version with laz4android? i only sucessful build the apk file with sdk 15 and below,sdk 19 and next always error. where is wrong? no body likes to help me? felipemdc and Leledumbo two gods will you likes to help me? Do what @BitBangerUSA says. A good way to ask is documented in the wiki and in my comments' signature. Otherwise, no help. thank you and BitBangerUSA for reply run build_debug_apk.bat errors like below: E:\lazarusandroid\laz4android\examples\androidlcl\android>REM Convert the java b ytecode to dalvik bytecode E:\lazarusandroid\laz4android\examples\androidlcl\android>call java -Djava.ext.d irs=E:\lazarusandroid\android-sdk19\sdk\platform-tools\lib\ -jar E:\lazarusandro id\android-sdk19\sdk\platform-tools\lib\dx.jar --dex --verbose --output=E:\lazar usandroid\laz4android\examples\androidlcl\android\\bin\classes.dex E:\lazarusand roid\laz4android\examples\androidlcl\android\\bin\classes Error: Unable to access jarfile E:\lazarusandroid\android- sdk19\sdk\platform-too ls\lib\dx.jar E:\lazarusandroid\laz4android\examples\androidlcl\android>REM It seams that dx c alls echo off E:\lazarusandroid\laz4android\examples\androidlcl\android>REM Now build the unsi gned APK E:\lazarusandroid\laz4android\examples\androidlcl\android>del E:\lazarusandroid\ laz4android\examples\androidlcl\android\\bin\androidlcltest- unsigned.apk 找不到 E:\lazarusandroid\laz4android\examples\androidlcl\android\bin\andr oidlclt est-unsigned.apk E:\lazarusandroid\laz4android\examples\androidlcl\android>call java -classpath E :\lazarusandroid\android-sdk19\sdk\tools\lib\sdklib.jar com.android.sdklib.build .ApkBuilderMain E:\lazarusandroid\laz4android\examples\androidlcl\android\\bin\a ndroidlcltest-unsigned.apk -v -u -z E:\lazarusandroid\laz4android\examples\andro idlcl\android\\bin\androidlcltest.ap_ -f E:\lazarusandroid\laz4android\examples\ androidlcl\android\\bin\classes.dex THIS TOOL IS DEPRECATED. See --help for more information. java.io.FileNotFoundException: E:\lazarusandroid\laz4android\examples\androidlcl \android\bin\classes.dex does not exist E:\lazarusandroid\laz4android\examples\androidlcl\android>REM Generating on the fly a debug key E:\lazarusandroid\laz4android\examples\androidlcl\android>rem keytool -genkey -v  -keystore bin\LCLDebugKey.keystore -alias LCLDebugKey -keyalg RSA -validity 100 00 -dname NAME -storepass zyzyzy -keypass zyzyzy E:\lazarusandroid\laz4android\examples\androidlcl\android>REM Signing the APK wi th a debug key E:\lazarusandroid\laz4android\examples\androidlcl\android>del bin\androidlcltest -unaligned.apk 找不到 E:\lazarusandroid\laz4android\examples\androidlcl\android\bin\andr oidlclt est-unaligned.apk E:\lazarusandroid\laz4android\examples\androidlcl\android>REM JDK1.6,Please use this command E:\lazarusandroid\laz4android\examples\androidlcl\android>REM jarsigner -verbose  -keystore bin\LCLDebugKey.keystore -keypass zyzyzy -storepass zyzyzy -signedjar  bin\androidlcltest-unaligned.apk bin\androidlcltest-unsigned.apk LCLDebugKey E:\lazarusandroid\laz4android\examples\androidlcl\android>REM JDK1.7 OR JDK1.8,P lease use this command E:\lazarusandroid\laz4android\examples\androidlcl\android>jarsigner -verbose -si galg MD5withRSA -digestalg SHA1 -keystore bin\LCLDebugKey.keystore -keypass zyzy zy -storepass zyzyzy -signedjar bin\androidlcltest-unaligned.apk bin\androidlclt est-unsigned.apk LCLDebugKey jarsigner: 无法打开 jar 文件: bin\androidlcltest-unsigned.apk E:\lazarusandroid\laz4android\examples\androidlcl\android>REM Align the final AP K package E:\lazarusandroid\laz4android\examples\androidlcl\android>zipalign -v 4 bin\andr oidlcltest-unaligned.apk bin\androidlcltest.apk Unable to open 'bin\androidlcltest-unaligned.apk' as zip archive E:\lazarusandroid\laz4android\examples\androidlcl\android>REM call and pause tog ether allow us to see the results in the end E:\lazarusandroid\laz4android\examples\androidlcl\android>pause ---------------------------------------------------------------------- Leledumbo · 2015-05-09 10:13 Quote from: greenzyzyzy on May 09, 2015, 11:43:09 amError: Unable to access jarfile E:\lazarusandroid\android-sdk19\sdk\platform- tools\lib\dx.jar Isn't the message clear? In my SDK, the file is located in: build- tools/22.0.1/lib/dx.jar, so it might have changed, no idea since when. I don't use the batch script to build the apk, ant is my way to go and it seems safer than relying on structure that google might change anytime. Ask google where, why and since when the location changes. ---------------------------------------------------------------------- greenzyzyzy · 2015-05-09 10:33 Quote from: Leledumbo on May 09, 2015, 12:13:05 pmQuote from: greenzyzyzy on May 09, 2015, 11:43:09 amError: Unable to access jarfile E:\lazarusandroid\android-sdk19\sdk\platform-tools\lib\dx.jar Isn't the message clear? In my SDK, the file is located in: build- tools/22.0.1/lib/dx.jar, so it might have changed, no idea since when. I don't use the batch script to build the apk, ant is my way to go and it seems safer than relying on structure that google might change anytime. Ask google where, why and since when the location changes. thank you very much,build ok.and how to use ant? a command line can solve it? ---------------------------------------------------------------------- Leledumbo · 2015-05-09 11:52 Quote from: greenzyzyzy on May 09, 2015, 12:33:09 pmand how to use ant? a command line can solve it? google: apache ant, read their docs ---------------------------------------------------------------------- felipemdc · 2015-05-10 10:41 I also currently use Ant, because the .bat script doesn't support the AdMob SDK. The downside is that to build the app I now have to do like this: 1> Boot to Windows 2> Build Pascal library 3> Copy the library to a common partition 4> Boot to Linux 5> In linux build with: cd project/android ant debug The windows batch building indeed needs to be updated when they make large changes in the Android SDK, which is far too often. So do like Leledumbo says and fix the error message by correcting the path if you want to build in Windows. I think this will be faster than configuring ant in Windows. ---------------------------------------------------------------------- greenzyzyzy · 2015-05-10 13:16 thanks all very much ---------------------------------------------------------------------- Leledumbo · 2015-05-10 15:14 Quote from: felipemdc on May 10, 2015, 12:41:57 pmSo do like Leledumbo says and fix the error message by correcting the path if you want to build in Windows. I think this will be faster than configuring ant in Windows. Last time I use windows, apache ant has a zipped archive ready to use for windows. Just need to put the binaries folder in PATH and ensuring JDK binaries are there, too.