31

How do I export a project in ZIP format in Android Studio?

I have always worked with Eclipse that has this feature.

Spikatrix
  • 20,225
  • 7
  • 37
  • 83
user3608814
  • 561
  • 1
  • 8
  • 23

11 Answers11

38

Starting with Android Studio 3.0, you can use File | Export to Zip File... to export your project. If you're using an older version, you can use the file manager of your operating system to pack the directory of your project into a .zip file.

yole
  • 92,896
  • 20
  • 260
  • 197
22

In Android Studio 4.1 the export as ZIP option has been moved to File - > Manage IDE Settings - > Export to Zip file

enter image description here

lava
  • 6,020
  • 2
  • 31
  • 28
Fish
  • 251
  • 2
  • 6
6

If you want to export your project to a .zip you'll need to upgrade your version of Android Studio to version 3.0

5
  1. right click on app folder
  2. then send to
  3. then compressed via zip
Box Box Box Box
  • 5,094
  • 10
  • 49
  • 67
Abhishek
  • 682
  • 6
  • 17
5
  1. Go to File
  2. Choose option Export to Zip File

Note: This option is removed in Android Studio 4.1

SHS
  • 1,414
  • 4
  • 26
  • 43
VVB
  • 7,363
  • 7
  • 49
  • 83
4

You can first push the project to Github and then download the project as zip. Only the necessary code will be pushed to Github, hence making it easier for others to go through the code.

Steps to push to Github:
1. In the Project Window, select Android. Only the app folder and necessary code can be seen.
2. Click on VCS -> Import from Version Control -> Share Project on Github.
3. Enter project name and description.
4. Enter a commit message. You can select/deselect files to be pushed.

Note: You will have to setup Github first in Android Studio.

After this you will see a notification on top right of the IDE saying 'Project pushed to Github' and a hyperlink to the Github repository.

You can then download the repository as zip. This might seem to be a long process but it would help in the long run as your code can be easily managed using VCS within Android Studio itself.

JacksonIsaac
  • 97
  • 1
  • 1
  • 5
  • I already have a version control and don't want to use the shelf feature all the time. I want to export without generated junk. The zip export worked really good but I can't find it anymore after update to AS 4.1... :/ – The incredible Jan Oct 27 '20 at 13:16
3
  1. File/ Manage IDE Settings/ Export to Zip File...
  2. Choose the directory you want the file to be in

    Wabam you got yourself a new zip file :D
    note to future viewers: I am on Android Studio Version 4.1.1

enter image description here

lava
  • 6,020
  • 2
  • 31
  • 28
Sammi Lin
  • 69
  • 4
  • 1
    Thanks for the answer! However, we seemed to already have the answer in: https://stackoverflow.com/a/64653406/3591480 If you feel like the answer is incomplete, you can improve the answer by suggesting an edit. Generally we will like to avoid duplicate answers as duplicate answers decreases readability. – Teng-pao Yu Dec 25 '20 at 06:57
  • Apologies, I missed that comment when I was looking through the post – Sammi Lin Jan 14 '21 at 21:23
2

Following worked for me, Android Studio 2.0, assuming there are no libs.

A. From the source project
1. Copy /app/build.gradle
2. Copy /app/src/* including subdirectories (only contains manifest, java and resources)

B. Create new project with the same package name, minSDK etc.
1. Replace /app/build.gradle
2. Replace /app/src/* including subdirectories

C. Synchronize

D. Clean Project

2

Windows:

First Open Command Window and set location of your android studio project folder like:

D:\MyApplication>

then type below command in it:

gradlew clean

then wait for complete clean process. after complete it now zip your project like below:

  • right click on your project folder
  • then select send to option
  • now select compressed via zip
Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
0

It's easy, if you use git:

git archive -o latest.zip HEAD
phnmnn
  • 12,813
  • 11
  • 47
  • 64
0

Setup Git if you haven't already in Android Studio. Its free. From the terminal provided in the Android Studio go to a new fresh directory. Run this command: git clone <app directory path>

This will copy all the required file to load the project and also the commit history to the current new directory.

Rakshit Tanti
  • 147
  • 2
  • 5