大家好,试图启动我的应用程序(一直工作到今天!!!)继续出现此错误:
APK文件C:\ Users \ User \ Documents \ App 0.0 \ Dooale \ app \ build \ outputs \ apk \ debug \ app-debug.apk在磁盘上不存在。安装APK时出错
我试图在我的电脑上在指定的路径中验证:C:\ Users \ User \ Documents \ App 0.0 \ Dooale \ app \ build \ outputs \并且实际上不存在!在输出中只有日志!!!这怎么可能?我能做什么?
谢谢你们
我设法解决了这些简单的步骤:
1 - 我在Build - > Clean Project之后去了android工作室等待它结束。 2 - 我回到Build - > Rebuild Project
3 - 我与Gradle重新同步。
通过这些简单的步骤,我设法解决了!
这个愚蠢的错误浪费了一整天的研究。
最近我用Fuel
替换了REST库Retrofit
,并添加了OkHttp
日志拦截器和它的Proguard
规则。然后我删除了拦截器,但忘了删除Proguard规则。
这个错误出现在第二天。我无法建立一个项目,甚至重新安装AS。然后我用apk
建造了一个Build > Generate Signed Bundle / APK
。在那里我看到警告:
AGPBI:{“kind”:“warning”,“text”:“Missing class:android.arch.paging.PositionalDataSource”,“sources”:[{}],“tool”:“D8”}
AGPBI:{“kind”:“警告”,“文字”:“规则
-keep public class *extends androidx.versionedparcelable.VersionedParcelable {\n \u003cinit\u003e();\n}
使用extends但实际上匹配实现。”,“sources”:[{}],“tool”:“D8”} AGPBI:{“kind “:”警告“,”文字“:”未找到类型org.conscrypt.Conscrypt
,默认或静态接口方法需要使用void okhttp3.internal.platform.ConscryptPlatform.configureSslSocketFactory(javax.net.ssl.SSLSocketFactory)
“,”来源“:[{”file“:”C:\ Users \ user \。 gradle这个\缓存\模块-2 \文件-2.1 \ com.squareup.okhttp3 \ okhttp \ 3.12.0 \ b36f4a04584c0fb0d9af2d3401cdff8dacb1ea54 \ okhttp-3.12.0.jar “}],” 工具 “:” D8" }
然后我从Proguard中删除了不必要的行。见How to resolve D8 warning: D8: Type `org.conscrypt.Conscrypt` was not found。
UPDATE
几个小时后,即使我恢复到之前的提交,问题也会消失。它也没有在另一台PC上重现。 Android Studio很奇怪。
为了不在每次代码更改时都重建项目,我将其添加到配置中(请参阅Android Studio not deploying changes to app)。
更新2
我使用Retrofit并将所有响应文件(JSON结构)保存在一个包中。我不得不将它们添加到proguard-rules.pro
:
-keep class com.example.data.network.model.** { *; }
如果我删除这一行,应用程序将不会编译消息:“AGPBI:{”kind“:”warning“,”text“:”Missing class:android.arch.paging.PositionalDataSource“,”sources“:[{ }], “工具”: “D8”}”。