I have an Android application that takes up a lot of my time and 90% of the total is due to 3 files that I don't know if they can be deleted or what would happen if I delete them.
The first is fileSnapShots.bin, located in .gradle/2.10/taskArtifacts , it is 22 MB, what happens if I delete it ? Can I do without it? It's very heavy...
The second and third are app-debug and app-debug-unaligned , located in app\build\outputs\apk , do they both work? 9MB between the two
The third one is mockable-android-23, located in \build\generated , I suppose this is useful to be able to run the app in android studio, but it weighs almost 23MB.
Can any of this be removed?
I answer your questions:
.gradle
inside the project directory can be deleted but will be created again when you build the project.As for the folder
\build
, it contains files that are generated when compiling, you can delete the content of this folder that contains\generated
e\intermediates
.If you delete this folder you will see a considerable reduction in the space on your disk , but remember that when you compile they are generated again.
app\build\outputs\apk
are .apk generated, one unaligned which you can align using the Zipalign tool , and the other, an aligned .apk which is a candidate to upload to the playstore but only if it was signed with your keystore. production, this is very important.I suppose that if you delete it nothing happens, but it means that it will take much longer to generate and compile the project.
I normally use two development spaces on different computers and when I want to move an app I just copy
build.gradle
and thesrc
, everything else is generated. Sometimes the file has given me an errorbuild.gradle
, but I solve it by creating a blank project and modifying the values from the other.edited
Regarding the question about the destination of the apk,
app\build\outputs\apk
if you want to upload the app to google play services, you have to upload therelease-aligned
one obtained by signing the apk.Generate Apk to upload to Google Play
To publish an App to it
Google Play
you must compile/build in moderelease
At the bottom left ofAndroid-studio
there is a tabBuild variants
open it and selectrelease
The apk must be signed and aligned, for this you must generate a file
keystore
Menu
Build->Generate Signed Apk
pressCreate New
and fill in the form.Things to keep in mind:
apps.tunombreo.corporacion.com
Then you can give
Build
once finished the explorer will open with the apk. The one you have to upload is the one that containsrelease
Official documentation App signing