Reputation: 128
Hello everyone trying to launch my app (which has always worked until today !!!) continues to present this error:
The APK file C:\Users\User\Documents\App 0.0\Dooale\app\build\outputs\apk\debug\app-debug.apk does not exist on disk. Error while Installing APK
I tried to verify on my PC in the indicated path: C: \ Users \ User \ Documents \ App 0.0 \ Dooale \ app \ build \ outputs \ and actually does not exist !!! In outputs there is only log !!! How is it possible? What can I do?
Thank you all
Upvotes: 3
Views: 3929
Reputation: 28819
This stupid error wasted a whole day of research.
Recently I have replaced REST library Fuel
with Retrofit
and added OkHttp
logging interceptor with it's Proguard
rules. Then I removed interceptor but forgot to remove Proguard rules.
This error appeared in the next day. I couldn't build a project, even reinstalled AS. Then I built an apk
with Build > Generate Signed Bundle / APK
. There I saw warnings:
AGPBI: {"kind":"warning","text":"Missing class: android.arch.paging.PositionalDataSource","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"The rule
-keep public class *extends androidx.versionedparcelable.VersionedParcelable {\n \u003cinit\u003e();\n}
uses extends but actually matches implements.","sources":[{}],"tool":"D8"} AGPBI: {"kind":"warning","text":"Typeorg.conscrypt.Conscrypt
was not found, it is required for default or static interface methods desugaring ofvoid okhttp3.internal.platform.ConscryptPlatform.configureSslSocketFactory(javax.net.ssl.SSLSocketFactory)
","sources":[{"file":"C:\Users\user\.gradle\caches\modules-2\files-2.1\com.squareup.okhttp3\okhttp\3.12.0\b36f4a04584c0fb0d9af2d3401cdff8dacb1ea54\okhttp-3.12.0.jar"}],"tool":"D8"}
Then I removed unnecessary lines from Proguard. See How to resolve D8 warning: D8: Type `org.conscrypt.Conscrypt` was not found.
UPDATE
After several hours a problem disappeared even if I reverted to previous commits. Also it didn't reproduce on another PC. Android Studio is weird.
In order not to rebuild the project every time at every change in code I added this to configuration (see Android Studio not deploying changes to app).
UPDATE 2
I use Retrofit and keep all response files (JSON structures) in one package. I had to add them to proguard-rules.pro
:
-keep class com.example.data.network.model.** { *; }
If I remove this line, an application won't compile with message: "AGPBI: {"kind":"warning","text":"Missing class: android.arch.paging.PositionalDataSource","sources":[{}],"tool":"D8"}".
Upvotes: 0
Reputation: 128
I managed to solve these simple steps:
1 - I went to the android studio on Build -> Clean Project After waiting for it to end. 2 - I'm back on Build -> Rebuild Project
3 - I resynchronized with Gradle.
With these simple steps I managed to solve !!!
Upvotes: 5