PackageInfo versionCode and versionName null on phone, but works on emulator

爷,独闯天下 提交于 2019-12-03 16:28:08

Does your manifest.xml contain android:versionCode and androd:versionName attributes?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.package.name"
  android:versionCode="2"
  android:versionName="1.1">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        ...
    </application>
</manifest>

Figured it out. The problem was between the keyboard and the chair. I was seeing null, when it fact the string was being built improperly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!