android-support-v4.jar中的意外顶级异常

当我想编译我的应用程序时,我有一个问题:

UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added`

这似乎是android-support-v4.jar的错误.

在我的项目中,我有3个库:appcompat,facebook,google_play_services.

我的毕业文件:

> AppProject / settings.gradle

include ':libraries:google_play_services',':libraries:appcompat',':libraries:facebook',':app'

> AppProject / build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}

> AppProject / app / build.gradle:

apply plugin: 'android'

dependencies {
    compile project(':libraries:appcompat')
    compile project(':libraries:facebook')
    compile project(':libraries:google_play_services')
    compile files('libs/android-async-http-1.4.3.jar')
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/libGoogleAnalyticsV2.jar')
    compile files('libs/universal-image-loader-1.8.4.jar')
    compile files('libs/urbanairship-lib-3.0.0.jar')
}

> AppProject / libraries / appcompat / build.gradle:

apply plugin: 'android-library'

dependencies {
    compile files('libs/android-support-v4.jar')
    compile files('libs/android-support-v7-appcompat.jar')
}

> AppProject / libraries / facebook / buidle.gradle:

apply plugin: 'android-library'

dependencies {
    compile files('libs/android-support-v4.jar')
}

> AppProject / libraries / google_play_services / buidle.gradle:

apply plugin: 'android-library'

dependencies {
    compile files('libs/google-play-services.jar')
}

但是当我编译它时,会出现这个错误:

Output:
        UNEXPECTED TOP-LEVEL EXCEPTION:
        java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/NotificationCompatIceCreamSandwich;

你可以帮我吗?

解决方法

我发现问题:

AppProject / settings.gradle

include ':libraries:facebook',':app'

AppProject /库/ Facebook的/的build.gradle

apply plugin: 'android-library'

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
}

AppProject /应用/的build.gradle

apply plugin: 'android'

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    compile 'com.android.support:appcompat-v7:18.0.+'
    compile 'com.google.android.gms:play-services:3.1.36'

    compile project(':libraries:facebook')
    compile files('libs/android-async-http-1.4.3.jar')
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/libGoogleAnalyticsV2.jar')
    compile files('libs/universal-image-loader-1.8.4.jar')
    compile files('libs/urbanairship-lib-3.0.0.jar')
}

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...