从Google Play商店安装时,Android应用程序升级挂起

时间:2019-03-18 00:07:25

标签: android

从Google Play应用商店升级我的应用时,遇到了一个奇怪的问题。

当我从旧版本升级到新版本时,我的应用程序冻结-该设备没有堆栈跟踪,没有日志,logcat中没有错误,只需以下内容:

03-17 23:48:18.402 24436-24436/? W/My App: Upgrading database - data will be transferred
03-17 23:48:21.221 4519-9571/? I/TaskMonitor: Top activity component: ComponentInfo{com.test.myApp/com.test.myApp.Launch} lookup 3ms, sleep 140788280ms
03-17 23:48:49.117 3344-3359/? W/ActivityManager: Activity pause timeout for ActivityRecord{24a1830 u0 com.test.myApp/.Launch t11658}
03-17 23:48:59.119 3344-3359/? W/ActivityManager: Activity stop timeout for ActivityRecord{24a1830 u0 com.test.myApp/.Launch t11658}

我的应用输出的最后一条日志来自我的数据库类(onUpgrade):

public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        Log.w("My App", "Upgrading database - data will be transferred");

        //RULES UPDATE
        try {
            Log.w("My App", "Creating temporary Rules table...");
            db.execSQL("CREATE TABLE Rules_new (_id INTEGER PRIMARY KEY AUTOINCREMENT, RuleName TEXT, RuleAlertFilter TEXT, RuleCriteria TEXT, RuleProfile TEXT, RuleEnabled BOOLEAN, RuleVibrate BOOLEAN, RuleVibratePattern TEXT, RuleAudio BOOLEAN, RuleAudioFile TEXT, RuleAppList TEXT)");
            Log.w("My App", "Temporary Rules table created.");
            Log.w("My App", "Creating temporary Filter table...");
            db.execSQL("CREATE TABLE Filters_new (_id INTEGER PRIMARY KEY AUTOINCREMENT, FilterType TEXT, FilterCriteriaType TEXT, FilterCriteria TEXT, FilterRuleID INTEGER)");
            Log.w("My App", "Temporary Filter table created.");
        }
        catch(SQLiteException ex)
        {
            Log.w("My App", "Error creating new tables: " + ex.getMessage());
        }
        Log.w("My App", "New tables created");

if(oldVersion<2) {
    //migration from v1-v2
.......

如您所见,下一条日志行将输出文本“正在创建临时规则表..”,但这永远不会得到输出。

我进行了一些进一步的测试,发现从设备上的Google Play商店中的产品版本手动升级到最新的apk时,升级成功(同一版本已上传到Google Play商店中进行Beta测试)。 / p>

0 个答案:

没有答案