Search code examples
android-studiomp4parser

Error while adding mp4parser library to a project in android studio


I'm trying to use mp4parser library in my project. My android studio version is 1.0.2. Here's what I've done so far:

  1. I've downloaded mp4parser zipfile from the link: https://github.com/sannies/mp4parser
  2. I've extracted the zip file to MyProjectName/app/libraries
  3. Renamed the folder to mp4parser
  4. Add this line of code to settings.gradle file:

    include ':app:libraries:mp4parser'
    
  5. Add this line of code to build.gradle (in dependencies block):

    compile project('libraries:mp4parser')

Now I want to sync the project with gradle files. This error pops up:

Error:Configuration with name 'default' not found.

I don't have this problem with other libraries. Seems that its only mp4parser that I have problem with. How can I fix this?


Solution

  • If you're including the library as source, the best thing to do is to unpack it somewhere and import it as a module.

    The error you're getting is cryptic but it means that the build system is looking for a build.gradle file at that location and not finding it (or it doesn't see an apply plugin statement in the file telling it what to do). I'm assuming that the library you're trying to use doesn't have a Gradle build script.

    If you import the library using the Android Studio UI, a build script will be generated for the module and you should be good to go.