sank20 / acra

Automatically exported from code.google.com/p/acra
0 stars 0 forks source link

Application_version set to "not_set" #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Received a crash report from user, application_version is "not_set"
2.
3.

What is the expected output? What do you see instead?
I expect to see the application version number

What version of the product are you using? On what operating system?
2.0.3, development was on OSX

Please provide any additional information below.
This is the 2nd release of my product where I was using ACRA. The first version 
where I used ACRA I received most Crash Reports with the version number, a 
couple reports had "not_set". Same is occuring with this new version of my app.

Original issue reported on code.google.com by cona...@gmail.com on 8 Dec 2010 at 8:40

GoogleCodeExporter commented 8 years ago
PackageManager pm = context.getPackageManager();
PackageInfo pi;
pi = pm.getPackageInfo(context.getPackageName(), 0);
if (pi != null) {
    // Application Version
    mCrashProperties.put(VERSION_NAME_KEY, pi.versionName != null ? "'" + pi.versionName : "not set");
}

I don't understand how this could ever fail :-(

I'll keep investigating.

Original comment by kevin.gaudin on 11 Dec 2010 at 12:18

GoogleCodeExporter commented 8 years ago
It looks like it's an issue with using a string reference instead of a raw 
string in the manifest versionName attribute.

See https://groups.google.com/d/msg/acra-discuss/qdL23C4YkTI/DH3E_ajW7esJ for a 
discussion about this.

Original comment by kevin.gaudin on 1 Mar 2011 at 3:21

GoogleCodeExporter commented 8 years ago
There's nothing we can do about this, except to note that a String reference 
cannot be resolved in the ApplicationInfo for some versions of Android. So you 
really need to code the application version directly into the AndroidManifest.

Eg not 
{code}
<manifest android:versionName="@string/version"/>
{code}

Original comment by william....@gmail.com on 16 Jul 2011 at 4:27