[
https://issues.apache.org/jira/browse/CB-10600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15193775#comment-15193775
]
ASF GitHub Bot commented on CB-10600:
-------------------------------------
Github user daserge commented on the pull request:
https://github.com/apache/cordova-android/pull/273#issuecomment-196445988
I've tested this way:
- `created project, added master android platform`
- `λ cordova run android --release` ->
```
Built the following apk(s):
f:/coho/CB-10600/test/platforms/android/build/outputs/apk/android-release-unsigned.apk
Using apk:
f:/coho/CB-10600/test/platforms/android/build/outputs/apk/android-release-unsigned.apk
Error: Failed to install apk to emulator: WARNING: linker: libdvm.so has
text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /data/local/tmp/android-release-unsigned.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
```
- `λ cordova run android --release -- --keystore=../my-release-key.keystore
--storePassword=password --alias=alias_name --password=password` ->
```
BUILD SUCCESSFUL
Total time: 6.286 secs
Built the following apk(s):
f:/coho/CB-10600/test/platforms/android/build/outputs/apk/android-release-unsigned.apk
f:/coho/CB-10600/test/platforms/android/build/outputs/apk/android-release.apk
Using apk:
f:/coho/CB-10600/test/platforms/android/build/outputs/apk/android-release-unsigned.apk
Error: Failed to install apk to emulator: WARNING: linker: libdvm.so has
text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /data/local/tmp/android-release-unsigned.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
```
So the first issue is that even though it has built a signed apk it uses an
unsigned one because of last modification time sorting probably.
If we do `cordova clean android` and run `-- --keystore` again it will
succeed (`--buildConfig` option works the same way).
Using your PR version makes `unsigned` apk to not be listed so that
successive builds after `cordova run android --release` work although I would
better change the sorting logic to prefer a signed build and output a message
about signing requirement in case of `run` command if the filter has returned
`unsigned` apk.
> 'cordova run android --release' does not use signed and zip-aligned version
> of APK
> ----------------------------------------------------------------------------------
>
> Key: CB-10600
> URL: https://issues.apache.org/jira/browse/CB-10600
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Environment: Tested on Windows 8.1 with Cordova CLI 6.0.0 (and Ionic
> CLI 1.7.14)
> Reporter: Eric Gopak
> Assignee: Joe Bowser
> Priority: Minor
> Labels: triaged
>
> Running command `cordova run android --release` builds the app successfully,
> both unsigned and signed/zip-aligned versions. However, it then tries to use
> the unsigned version of the APK. Here are the last lines of the output:
> .....
> BUILD SUCCESSFUL
> Total time: 31.35 secs
> Built the following apk(s):
>
> C:/XXXXX/platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk
> C:/XXXXX/platforms/android/build/outputs/apk/android-armv7-release.apk
> Using apk:
> C:/XXXXX/platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk
> ERROR running one or more of the platforms: Failed to install apk to device:
> pkg: /data/local/tmp/android-armv7-release-unsigned.apk
> Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
> You may not have the required environment or OS to run this project
> It has worked before I updated Cordova with 'npm install -g cordova'.
> I specify signing properties in a file 'release-signing.properties', which I
> copy to platforms/android/ folder. During the run/build I get prompted for
> the password, just as it has always been.
> I believe it is just a problem of choosing the wrong APK from the list of
> built APKs (Cordova probably chooses the one that comes earlier
> lexicographically)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]