Google Drive Web API(Android应用程序)-创建文件在调试中工作正常,在proguard中不工作

k

我正在尝试创建创建文件的简单android应用。它在调试时可以完美运行,但是,当我使用proguard导出应用程序时,它仅创建名称为“ UNTITLED”的文件。这怎么可能?文件内容正确,只是标题始终未定义。只需确定它在这里:

File file = new File();
file.setTitle("hello.txt");
file.setMimeType(MIME_TYPE);

// file content
java.io.File temp = createTempFile("simple content");
FileContent mediaContent = new FileContent(MIME_TYPE, temp);
File createdFile = service.files().insert(file, mediaContent).execute();
k

好的,我找到了原因-绝对是proguard问题,解决方案是将其添加到我的proguard配置中:

-keep class com.google.api.** {*;}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用 Google Drive API 在 Android Studio 应用程序中扫描文档?

Google Drive (Web) 中的下载如何工作?

创建 Google App Script Web 应用程序以将文件以最小范围上传到 Google Drive

使用 Android java 应用程序中的服务帐户连接到 google Drive API v3

使用Google Drive API上传PDF文件-Google Drive Web Client中没有预览

如何使用Google的Python Drive Client API在Team Drive中创建文件夹?

如何在Google Drive Android API中获取已创建文件夹的DriveId

Google Drive 管理应用程序中缺少应用程序图标

选择帐户后,带有 Google Drive API 的 Android 应用程序卡住了。为什么?

Google Sheet API 4 - 我们可以访问由 Google Drive 中的 App Engine 应用程序创建的文件吗?

利用MapActivity的Android应用程序中的Google API错误

使用 pydrive 或 google drive api 在 google drive 中复制文件

在Google Drive API PHP Client v2中创建文件快捷方式

如何使用Google API在Team Drive中创建文件夹?

403:在google drive api php中创建文件夹时权限不足

使用 GoogleWebAuthorizationBroker 进行 Google API 授权:如何在 Web 应用程序中管理多个用户?

拦截或获取 Google Drive 文件的回调保存并在插件/应用程序脚本中打开

适用于Android的Google Drive Web服务API-在文件夹中显示文件名

Node js中的Google Drive File Download API无法正常工作?

在向当前用户分配该文件的权限之前,我们可以使用 Google App Maker 应用程序和 Drive API 在 Google Drive 中创建一个文件吗?

Google +登录并在iOS应用程序的Google Drive中将.csv文件保存

计划Android Google Drive API中的drive.appdata范围

使用 Google Drive REST API 创建文件访问请求

使用 PHP 创建文件夹 Google Drive API

Web 应用程序中的 Restful API

Google Drive API附加文件?

Google Drive API文件搜索

Google云端硬盘API-我可以将Google文档集成到我的Web应用程序中吗?

使用Google App Engine创建Web应用程序?