• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

avianey/facebook-api-android-maven: The mavenized Facebook Android SDK on Maven ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

avianey/facebook-api-android-maven

开源软件地址(OpenSource Url):

https://github.com/avianey/facebook-api-android-maven

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource 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
}



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap