Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to find/set up for 'Artifact' in Android Studio?

I'm starting up in the Android dev. environment, and I'm at the point where I'd like to distribute my apps to a wider test environment than my own phone and simulator.

Along these lines, I've been trying to build a signed debug apk which i can email, install, etc. My problem is that many many instructions on how to do this provide a set of steps which begin with "Go to 'File' in your Android Studio, select 'Project Structure' and then click 'Artifacts' in your left pane.

Problem is ...i don't have any 'Artifacts' in my left pane. I've got an 'SDK Location', 'Project' and under 'Modules' an 'app'.

I've checked the other projects I've built and none of those have an 'Artifacts' either. So...where, how do I set up my environment so that I have this 'Artifacts' in my left pane which I apprantly need to set up my signed debug apk.

I'm using Android Studio Version 1.1.0.

Many thanks.

like image 356
jdosser Avatar asked Mar 30 '15 21:03

jdosser


2 Answers

No need to worry about 'artifacts' just go to your workspace folder from Windows Explorer, then navigate to app->build->outputs you can see the apk folder. Thats all.

like image 107
user5649834 Avatar answered Sep 16 '22 19:09

user5649834


I had this issue as well when starting.

The problem is that if any of your modules have a Manifest.xml file, AS will automatically assume you need an aar and all modules, even if they are java modules will follow suit.

In order to remedy, you will have to create a new project with no activity, close the studio. Then go to the directory that the app lives at. Delete the default app folder and update the settings.gradle to remove the include of 'app'.

Reload the project and AS will recognize it is a java only project and when you press F4 for module settings you will see you have the option to add artifacts, one of which is jar.

Another think to keep in mind, if you are developing android only jar's (obviously very likely), you will need to go to libraries tab and add from maven the com.google.android:android:{version} so the you can build your project. Set the scope to provided since whomever is using it will provide that dependency.

Most recent version as of this post is 4.1.1.4

EDIT:

If you set the project SDK to be of an Android variant, you won't need to include the android library.

like image 42
Justin Avatar answered Sep 17 '22 19:09

Justin