Skip to content Skip to sidebar Skip to footer

How To Add "empty Module" In Android Studio?

I am trying to add AndEngine to my Android Project using the tutorial here: https://docs.google.com/document/d/1fcSowvlKMqfTjM9r1mMP48KEhWbkJZGBDR5duFg4QYc/edit I am stuck at Step

Solution 1:

Their instructions were written for Android Studio 0.2; this dialog has changed since then. They have some hasty steps for 0.3 which should work; I've amended them:

  • Download andengine.jar (Google it, there is no official download)
  • Create your own libs folder in your project
  • Copy andengine.jar into this folder
  • File > Project Structure > Modules > Dependencies > + button > File Dependency > select andengine.jar

If you need more help, there are many other answers on SO on how to add a jar library to Android Studio; they vary a little bit based on what version of Android Studio they're written for, but they should help you out. Many of them have you modify your build.gradle file directly; the UI steps above accomplish much the same thing and make the edits on your behalf.

Solution 2:

You can simply copy the AndEngine module inside your project directory and then configure your build.gradle and settings.gradle to include it in to dependencies like

----YOUR_PROJECT---AndEngine--res--src-- .....-- build.gradle---YOUR_MODULE--res--src--build.gradle (no : A)----settings.gradle

build.gradle (No. A) file

  dependencies {
       compile project(':AndEngine')
   }

settings.gradle :

include':YOUR_MODULE'include':AndEngine'

As Observed AndEngine is not moved to gradle yet, In that case download create jar using ant or eclipse.

The create a libs folder inside your Project

  ----YOUR_PROJECT

   ---YOUR_MODULE--libs
       -AndEngine.jar--res--src--build.gradle (no : A)
 ----settings.gradle

Now go to File > Project Structure > Modules > Dependencies > + green button > File Dependency > select AndEngine.jar and press OK

You will see these lines will be automatically added in your build.gradle file inside dependencies, you can add this manually as well no difference.

      compile files('libs/AndEngine.jar')

Post a Comment for "How To Add "empty Module" In Android Studio?"