PDA

View Full Version : Android Native Build - Release build gives a jarsigner error



parky128
10 Apr 2012, 6:53 AM
Hi,

I'm trying to build my application for Android for releasing onto Google Play for distribution. When I try and use the release key I generated using keytool and the password I have assigned, I get the following error during the build:


C:\Sencha\Projects\PPTouch>sencha app build native
[INFO] Deploying your application to C:\Sencha\Projects\PPTouch\build\package
[INFO] Copied sdk-2.0.0-backup/sencha-touch.js
[INFO] Copied Lib/markerwithlabel.js
[INFO] Copied Lib/markermanager.js
[INFO] Copied Scripts/HistoryMarkerManager.js
[INFO] Copied app.js
[INFO] Copied resources/css/app.css
[INFO] Copied resources/css/pptouch.css
[INFO] Copied resources/images
[INFO] Copied resources/icons
[INFO] Copied resources/loading
[INFO] Resolving your application dependencies (file:///C:/Sencha/Projects/PPTou
ch/index.html)
[INFO] Found 233 dependencies. Concatenating all into 'C:\Sencha\Projects\PPTouc
h\build\package\app.js'
[INFO] Processed sdk-2.0.0-backup/sencha-touch.js
[INFO] Minifying sdk-2.0.0-backup/sencha-touch.js
[INFO] Processed Lib/markerwithlabel.js
[INFO] Minifying Lib/markerwithlabel.js
[INFO] Processed Lib/markermanager.js
[INFO] Minifying Lib/markermanager.js
[INFO] Processed Scripts/HistoryMarkerManager.js
[INFO] Minifying Scripts/HistoryMarkerManager.js
[INFO] Processed app.js
[INFO] Minifying app.js
[INFO] Minifying resources/css/app.css
[INFO] Minifying resources/css/pptouch.css
[INFO] Minified sdk-2.0.0-backup/sencha-touch.js
[INFO] Minified Lib/markerwithlabel.js
[INFO] Minified Scripts/HistoryMarkerManager.js
[INFO] Minified Lib/markermanager.js
[INFO] Minified resources/css/pptouch.css
[INFO] Minified app.js
[INFO] Minified resources/css/app.css
[INFO] Generated app.json
[INFO] Embedded microloader into index.html
[INFO] Packaging your application as a native app...
[INFO] Created directory C:\Sencha\Projects\PPTouch\build\nativeAndroid\src\sbs\
pinpointers\pptouch
Added file C:\Sencha\Projects\PPTouch\build\nativeAndroid\src\sbs\pinpointers\pp
touch\STActivity.java
Created directory C:\Sencha\Projects\PPTouch\build\nativeAndroid\res
Created directory C:\Sencha\Projects\PPTouch\build\nativeAndroid\bin
Created directory C:\Sencha\Projects\PPTouch\build\nativeAndroid\libs
Created directory C:\Sencha\Projects\PPTouch\build\nativeAndroid\res\values
Added file C:\Sencha\Projects\PPTouch\build\nativeAndroid\res\values\strings.xml

Created directory C:\Sencha\Projects\PPTouch\build\nativeAndroid\res\layout
Added file C:\Sencha\Projects\PPTouch\build\nativeAndroid\res\layout\main.xml
Added file C:\Sencha\Projects\PPTouch\build\nativeAndroid\AndroidManifest.xml
Added file C:\Sencha\Projects\PPTouch\build\nativeAndroid\build.xml
Added file C:\Sencha\Projects\PPTouch\build\nativeAndroid\proguard.cfg
Buildfile: C:\Sencha\Projects\PPTouch\build\nativeAndroid\build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:

-setup:
[echo] Gathering info for PinpointersTouch...
[setup] Android SDK Tools Revision 16
[setup] Project Target: Android 2.1
[setup] API level: 7
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]

-build-setup:
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Sencha\Projects\PPTouch\build\nativeAndroid\bin\res
[mkdir] Created dir: C:\Sencha\Projects\PPTouch\build\nativeAndroid\gen
[mkdir] Created dir: C:\Sencha\Projects\PPTouch\build\nativeAndroid\bin\clas
ses

-pre-build:

-code-gen:
[echo] ----------
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...

-pre-compile:

-compile:
[javac] Compiling 2 source files to C:\Sencha\Projects\PPTouch\build\nativeA
ndroid\bin\classes

-post-compile:

-obfuscate:

-dex:
[dex] Converting compiled files and external libraries into C:\Sencha\Proj
ects\PPTouch\build\nativeAndroid\bin\classes.dex...

-crunch:
[crunch] libpng error: Read Error
[crunch] libpng error: Read Error
[crunch] libpng error: Read Error
[crunch] Crunching PNG Files in source dir: C:\Sencha\Projects\PPTouch\build\
nativeAndroid\res
[crunch] To destination dir: C:\Sencha\Projects\PPTouch\build\nativeAndroid\b
in\res
[crunch] Processing image to cache: C:\Sencha\Projects\PPTouch\build\nativeAn
droid\res\drawable-hdpi\icon.png => C:\Sencha\Projects\PPTouch\build\nativeAndro
id\bin\res\drawable-hdpi\icon.png
[crunch] Processing image to cache: C:\Sencha\Projects\PPTouch\build\nativeAn
droid\res\drawable-ldpi\icon.png => C:\Sencha\Projects\PPTouch\build\nativeAndro
id\bin\res\drawable-ldpi\icon.png
[crunch] Processing image to cache: C:\Sencha\Projects\PPTouch\build\nativeAn
droid\res\drawable-mdpi\icon.png => C:\Sencha\Projects\PPTouch\build\nativeAndro
id\bin\res\drawable-mdpi\icon.png
[crunch] Crunched 3 PNG files to update cache

-package-resources:
[aapt] Creating full resource package...

-package:
[apkbuilder] Current build type is different than previous build: forced apkbuil
der run.
[apkbuilder] Creating PinpointersTouch-release-unsigned.apk for release...

-release-prompt-for-password:

-release-nosign:
[echo] No key.store and key.alias properties found in build.properties.
[echo] Please sign C:\Sencha\Projects\PPTouch\build\nativeAndroid\bin\Pinpo
intersTouch-release-unsigned.apk manually
[echo] and run zipalign from the Android SDK tools.
[propertyfile] Creating new property file: C:\Sencha\Projects\PPTouch\build\nati
veAndroid\bin\build.prop
[propertyfile] Updating property file: C:\Sencha\Projects\PPTouch\build\nativeAn
droid\bin\build.prop
[propertyfile] Updating property file: C:\Sencha\Projects\PPTouch\build\nativeAn
droid\bin\build.prop
[propertyfile] Updating property file: C:\Sencha\Projects\PPTouch\build\nativeAn
droid\bin\build.prop

release:

BUILD SUCCESSFUL
Total time: 6 seconds
""C:/AndroidSDK/android-sdk/tools/android" create project --target android-7 --n
ame PinpointersTouch --activity STActivity --path "C:\Sencha\Projects\PPTouch\bu
ild\nativeAndroid/" --package sbs.pinpointers.pptouch"
Could not sign application with error: 1
Failed to package application
[ERROR] 'jarsigner' is not recognized as an internal or external command,
operable program or batch file.
Copy operation failed src=C:\Sencha\Projects\PPTouch\build\package//icon.png dst
=C:\Sencha\Projects\PPTouch\build\nativeAndroid//res/drawable-ldpi/icon.png
Copy operation failed src=C:\Sencha\Projects\PPTouch\build\package//icon.png dst
=C:\Sencha\Projects\PPTouch\build\nativeAndroid//res/drawable-mdpi/icon.png
Copy operation failed src=C:\Sencha\Projects\PPTouch\build\package//icon.png dst
=C:\Sencha\Projects\PPTouch\build\nativeAndroid//res/drawable-hdpi/icon.png

C:\Sencha\Projects\PPTouch>

This works fine in debug mode using my debug key, so I can only assume its something to do with my release key but I am unsure what.

Here is my config file too:


{
"applicationName":"Pinpointers Touch",
"applicationId":"sbs.pinpointers.pptouch",
"versionString":"1.0",
"iconName":"icon.png",
"inputPath":".",
"outputPath":"build/",
"configuration":"Release",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"C:/Keystore/pptouch-release-key.keystore",
"certificatePassword": "<password>",
"certificateAlias":"pptouch",
"sdkPath":"C:/AndroidSDK/android-sdk",
"androidAPILevel":"7",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}

Any advice on what could be causing me this jarsigner error?

Thanks

parky128
10 Apr 2012, 7:30 AM
I discovered that my Environment Variables on my machine were not setup correctly.

I'm using Windows 7 64 bit and had to add a PATH variable mapped to the bin directory of where the jdk is on my machine (C:\Program Files\Java\jdk1.7.0_03\bin).

I already had a JAVA_HOME which is mapped a level up (C:\Program Files\Java\jdk1.7.0_03).

The Release version of the build is now packaging for me, although I cant upload it to Google Play as it expects the apk file to have a 48 x 48 icon which it says is not present.

In fact I have already posted a separate thread on this issue where although the native build completes, the launcher icon I specify in my config file never gets used and I end up with a 'res' folder in the output directory as well as the apk file. This res folder contains 'drawable-' prefixed named folders each containing a zero sized png which doesnt open for viewing. Frustrating as it seems I am very close to being able to distribute my application :(

ronaldoneal
10 Apr 2012, 8:27 PM
Same problem. So close...so far.

kolodziejczyk
5 Mar 2014, 1:32 AM
Edit : wrong subject