Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio and AndEngine - package does not exist

I've got problem with adding AndEngine to Google Android Studio IDE.

  1. I downloaded AndEngine from git and extract it to the folder.
  2. In my existing project I clicked File>Project Structure>Modeles
  3. In middle column green plus>new module>empty module and I selected AndEngine folder
  4. In middle column i select my project then Dependencies>green plus at right>Module Dependency and I selected AndEngineModule.

When i try to run it there are errors like this:

Gradle: error: package org.andengine.engine.camera does not exist
like image 798
user2631570 Avatar asked Jul 29 '13 19:07

user2631570


1 Answers

I did the same! I am not sure how does it work exactly. But It seems that Android Studio uses libraries 'just for source' to find the libraries and then IDE uses Gradle like external build tool.

So I have created the libs directory in my project and move *.jar files there. I have added libraries files (*.jar) into project dependencies. Than I can use org.andegine package in my project sources but I had still the error so I have added dependencies also into build.gradle.

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    //compile files('libs/andengine.jar')  // for single file
    compile fileTree(dir: 'libs', include: '*.jar')  // for all files in directory
}
like image 66
radeklos Avatar answered Nov 10 '22 17:11

radeklos