Android Studio and AndEngine - the package does not exist

I have a problem with adding AndEngine to the Google Android Studio IDE.

  • I downloaded AndEngine from git and extracted it to a folder.
  • In my existing project, I clicked File> Project Structure> Models
  • In the middle column, green pluses> new module> empty module, and I selected the AndEngine folder
  • In the middle column, I select my project, then Dependencies> Green Plus on the right side> Module Dependency, and I selected AndEngineModule.

When I try to start it, the following errors appear:

Gradle: error: package org.andengine.engine.camera does not exist 
+6
source share
1 answer

I did the same! I'm not sure how this works. But it looks like Android Studio uses source-only libraries to find libraries, and then the IDE uses Gradle as an external build tool.

So, I created the libs directory in my project and moved the *.jar files there. I added library files ( *.jar ) depending on the project. How can I use the org.andegine package in my project sources, but I still had a bug, so I added dependencies to build.gradle as 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 } 
+2
source

Source: https://habr.com/ru/post/950573/


All Articles