Google Drive Sqlite 数据库上传不工作

Google Drive Sqlite db upload not working

我想备份和恢复我的 sqlite 数据库。为此,我使用 google 驱动器 api。我已经使用了这个 this 演示代码。一切都很完美。我可以上传和下载我的数据库,直到我卸载我的应用程序。

但后来我注意到一个奇怪的行为。场景如下

这是我的上传代码....

public boolean createFile() {
        DriveId dId = null;
        String mimeType = MimeTypeMap.getSingleton().getExtensionFromMimeType("db");

        if (mGoogleApiClient != null && mGoogleApiClient.isConnected())
            try {
                DriveFolder pFldr = Drive.DriveApi.getAppFolder(mGoogleApiClient);
                if (pFldr != null) {
                    File file = context.getDatabasePath(db.getDatabaseName());
                    DriveContents cont = file2Cont(null, file);
                    MetadataChangeSet meta = new MetadataChangeSet.Builder().setTitle(Google_Drive_File).
                            setMimeType(mimeType).build();
                    DriveFolder.DriveFileResult r1 = pFldr.createFile(mGoogleApiClient, meta, cont).await();
                    DriveFile dFil = r1 != null && r1.getStatus().isSuccess() ? r1.getDriveFile() : null;
                    if (dFil != null) {
                        DriveResource.MetadataResult r2 = dFil.getMetadata(mGoogleApiClient).await();
                        if (r2 != null && r2.getStatus().isSuccess()) {
                            dId = r2.getMetadata().getDriveId();
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
                return false;
            }
        return dId == null ? false : true;
    }

请帮帮我....

好吧,我已经解决了....我没有获取文件,因为我在 auth 证书中使用了调试密钥。一旦我用 release 更改调试密钥,一切都会完美无缺。