Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Development

Reply
New Contributor
Posts: 2
Registered: ‎05-23-2012
My Device: None
My Carrier: Rogers
Accepted Solution

apk2bar problem with versionCode

I have a version code created off a date time stamp as part of an automated build. The value is 

 

android:versionCode="1201010004"

 

which is totally valid since it is a small enough integer as required and it works just fine in the play store.

 

However when I try a apk2bar run of my apk I get an error message like this 

 

[ERROR] [BarGenerator] Invalid value "1.120101.4.0" for Package-Version.
Invalid value "1.120101.4.0" for Application-Version.
my-app.apk ............................................ failed
Summary: Total Apk files # 1; succeeded: 0; skipped: 0; failed: 1

 

Looks like a bug in the apk2bar tool... 

 

Can somebody confirm and maybe fix up the tool?

 

Thanks

 

manfred

New Contributor
Posts: 2
Registered: ‎05-23-2012
My Device: None
My Carrier: Rogers

Re: apk2bar problem with versionCode

Just a ping. I am trying to port a big customer app to BAR and this issue is kind of annoying. It forces me to have a different version code for Playbook compared to Play and other stores. Can somebody from RIM look into this or contact me? 

 

I tried with the command line beta tools and the issue still persists.

 

manfred

BlackBerry Development Advisor
Posts: 98
Registered: ‎11-21-2008
My Device: Z10
My Carrier: Bell

Re: apk2bar problem with versionCode

Hi Manfred,

 

This error message is the result of using an unsupported value within your Manifest. The value of versionCode from the AndroidManifest file is mapped as the  Package-Version value for the newly created MANIFEST.MF file.

 

As documented within the Android Developer docs, the versionCode value should be "an integer value that represents the version of the application code, relative to other versions." Your value of 1201010004 is too large and should be adjusted to reflect the number of releases (ie. 1, 2, 3...) of  your application.

 

Alternatively, you can create an LSV file (<apk-filename>.lsv) in the same location as your APK file and run the apk2bar command-line argument. The LSV file can contain a more specific value for Package-Version to map to (ie. 2.1.4.5).

 

Hopefully this helps.

James Dreher
BlackBerry Development Advisor
Regular Contributor
Posts: 84
Registered: ‎01-31-2013
My Device: Simulator !!!
My Carrier: 8608800458

Re: apk2bar problem with versionCode

jdreher=> Having a ton of trouble getting the right "package-version" number for my app. Seems like the "sign for app world" task in Eclipse takes the value in the .lsv file and appends stuff on to it or increments it with unknown logic. 

 

How do we set a version number here ? What is the logic behind how this is incremented from the lsv file when you sign an app in eclipse.

 

The issue is this: If the user has any way to see the "package-version" then I need to have some control over that. Right now I have none. 

New Contributor
Posts: 4
Registered: ‎01-28-2014
My Device: Z10
My Carrier: Verizon

Re: apk2bar problem with versionCode

[ Edited ]

I finally solved it by manipulating the manifest version number and re-signing the file.