Closed GoogleCodeExporter closed 9 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
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
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
Original issue reported on code.google.com by
cona...@gmail.com
on 8 Dec 2010 at 8:40