Code Monkey home page Code Monkey logo

facebook-api-android-maven's Introduction

Facebook Android SDK for Maven & Gradle

Current port is based on the v3.18.0 available at https://developers.facebook.com/android/
The API is packaged as an aar and available from Maven Central Repository for use with Maven or Gradle.

How to use

Maven

The aar dependency requires the use of the maven-android-plugin 3.8.1+ with maven 3.1.1+ :

<dependency>
  <groupId>fr.avianey</groupId>
  <artifactId>facebook-android-api</artifactId>
  <version>3.18.0</version>
  <type>aar</type>
</dependency>

If you want to use a newer version of the android-support-v4 dependency, exclude the old one with this line :

<dependency>
  <groupId>fr.avianey</groupId>
  <artifactId>facebook-android-api</artifactId>
  ...
  <exclusions>
    <exclusion>
      <artifactId>support-v4</artifactId>
      <groupId>com.google.android</groupId>
    </exclusion>
  </exclusions>
</dependency>

You might want to add the jar dependency as well to support code completion in Eclipse ADT. Adding the jar will result in DEX errors at build time as the Facebook API classes will be added twice to the generated apk. To solve the problem, build your project from command line and reference the jar dependency in the m2e (Eclipse only) Maven profile :

<profiles>
  <profile>
    <id>m2e</id>
    <activation>
      <property>
        <name>m2e.version</name>
      </property>
    </activation>
    <dependencies>
      <dependency>
        <groupId>fr.avianey</groupId>
        <artifactId>facebook-android-api</artifactId>
        <version>3.18.0</version>
        <type>jar</type>
        <exclusions>
          <exclusion>
            <artifactId>support-v4</artifactId>
            <groupId>com.google.android</groupId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </profile>
</profiles>

Gradle

Add the following dependency to your build.gradle

dependencies {
  compile 'fr.avianey:facebook-android-api:+@aar'
  // other dependencies
}

If you want to use a newer version of the android-support-v4 dependency, exclude the old one with this line :

configurations.all {
  exclude group: 'com.google.android', module: 'support-v4', version: 'r7'
  // other configurations
}

facebook-api-android-maven's People

Contributors

anupcowkur avatar avianey avatar bryant1410 avatar mxr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.