【问题标题】:android application resetting to older versionandroid应用程序重置为旧版本
【发布时间】:2014-01-06 08:55:59
【问题描述】:

我制作了一个预装在特定制造商的安卓设备上的应用程序。在此之后,我发布了应用程序的升级,例如初始版本 1.0.0.0 到升级版本 1.2.0.0。升级应用程序后,如果用户重新启动手机,那么我的应用程序将转到 1.0.0.0 的初始版本。

不知道为什么会这样?将应用程序绑定到设备有问题吗?

注意:我是通过我的服务器而不是从 Play 商店更新我的应用程序,并且此问题仅在应用程序预安装在设备上时才会重现。

在两个版本的 mainfest 文件中,我忘记更改 android:versionCode 值,在两个版本 android:versionCode=3 中。是否因此而产生问题?

我也更改了 Application 类的包名,所以这是造成问题吗?

第一个版本的清单:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.xxx.apps.spinr"
    android:versionCode="1"
    android:versionName="1.0.0.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="11" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


        <application
            android:icon="@drawable/app_icon"
            android:label="@string/app_name"
            android:theme="@style/SpinrTheme"
            android:name="com.abc.xyz.GDApplication">
            <activity
                android:name=".SplashActivity"
                android:label="@string/title_activity_splash" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    </application>
</manifest>

第二版的 Mainfest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.xxx.apps.spinr"
        android:versionCode="1"
        android:versionName="1.2.0.0" >

        <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="11" />
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


            <application
                android:icon="@drawable/app_icon"
                android:label="@string/app_name"
                android:theme="@style/SpinrTheme"
                android:name="com.xxx.apps.GDApplication">
                <activity
                    android:name=".SplashActivity"
                    android:label="@string/title_activity_splash" >
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN" />

                        <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>
                </activity>
        </application>
    </manifest>

【问题讨论】:

  • 你能解释一下为什么你认为它仍然是第 1 版吗?你期望有什么不同,而你没有看到。
  • 在设置 -> 应用程序 -> MyApp 重启后版本是 1.0.0.0,而不是升级版本 1.2.0.0。当我启动应用程序时,我发现应用程序的旧版本
  • 重启前设置中的版本是 1.2 吗?
  • 是的,并且这个问题只发生在那些预装了应用程序的设备上。我已经在其他未预装应用程序的设备上尝试过升级版本正常工作,并且在设置中显示的版本为 1.2.0.0。
  • 其实google play从来没有为同一个版本号的应用发布更新,所以你必须把版本号改成2。也许这就是问题所在。

标签: android installation


【解决方案1】:

感谢您的建议。正如@Mahmoud 在评论中建议的那样,“google play 永远不会为具有相同版本代码的应用程序发布更新”,所以我增加了应用程序的版本代码并且它运行良好。 @Rat-a-tat-a-tat Ratatouille 正如我在问题中所说的那样,我没有通过 google play 更新我的应用程序,也没有我的应用程序在 Play 商店中,所以我最初无法弄清楚这一点。无论如何感谢您的帮助。

所以结论是

每当您要发送应用升级时,请始终增加版本代码 应用的

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-16
    • 2011-02-14
    • 2013-08-27
    • 2021-01-23
    • 2018-06-21
    • 2011-12-25
    • 1970-01-01
    相关资源
    最近更新 更多