【问题标题】:My gradle build is not running after updating the android project in android studio在 android studio 中更新 android 项目后,我的 gradle 构建没有运行
【发布时间】:2018-05-26 05:54:32
【问题描述】:

更新项目后 Android 源代码未运行。它给出了以下错误。

程序类型已经存在:org.apache.http.auth.AuthSchemeProvider Message{kind=ERROR, text=Program type already present: org.apache.http.auth.AuthSchemeProvider, sources=[Unknown source file], tool name=Optional.of(D8)}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.github.danysantiago:sendgrid-android:1', {
    exclude group: 'org.apache.httpcomponents.httpclient-android'
    exclude group: 'org.apache.httpcomponents.httpclient'
})

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.github.mancj:MaterialSearchBar:0.6'
// Glide image library
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.makeramen:roundedimageview:2.2.1'
implementation 'io.card:android-sdk:5.5.0'
implementation 'com.roughike:bottom-bar:2.1.1'
implementation 'com.kaopiz:kprogresshud:1.0.5'
implementation 'com.jude:swipebackhelper:3.1.2'
implementation 'com.google.android.gms:play-services-analytics:8.4.0'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
implementation 'com.google.zxing:core:3.2.1'
implementation 'com.xwray:passwordview:1.0'
implementation 'com.github.javiersantos:AppUpdater:2.6.4'
/*implementation 'com.sun.mail:android-mail:1.5.5'
    implementation 'com.sun.mail:android-activation:1.5.5'*/
implementation 'com.google.android.gms:play-services-location:8.4.0'
implementation 'it.sephiroth.android.library.targettooltip:target-tooltip-library:1.3.15'
implementation 'com.stripe:stripe-android:6.0.0'
implementation 'org.altbeacon:android-beacon-library:2.12.4'
implementation files('libs/volley.jar')
implementation 'com.shawnlin:number-picker:2.4.6'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
    transitive = true;
}
implementation project(':NPLibrary')

}

【问题讨论】:

标签: android android-gradle-plugin build.gradle


【解决方案1】:

尝试添加这一行

implementation('com.github.danysantiago:sendgrid-android:1', {
    exclude group: 'org.apache.httpcomponents.httpclient-android'
    exclude group: 'org.apache.httpcomponents.httpclient'
    //add this line
    exclude group: 'org.apache.http.auth'
})

更新 1

删除这一行

implementation files('libs/volley.jar')

因为你已经指定了。

implementation fileTree(include: ['*.jar'], dir: 'libs')

【讨论】:

  • implementation filesimplementation fileTree 不冲突
【解决方案2】:

如果你更新了你的 android studio 我得说,新版本的 Android Studio 有一些严重的问题,试试这个作为初学者

升级:

implementation 'com.google.android.gms:play-services-analytics:8.4.0'
implementation 'com.google.android.gms:play-services-location:8.4.0'

到:

implementation 'com.google.android.gms:play-services-analytics:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'

然后检查您的项目级别 Gradle 并添加与完全相同版本的这一行:

classpath 'com.google.gms:google-services:3.2.0'

希望对你有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-12
    • 2017-03-28
    • 2017-01-18
    • 1970-01-01
    • 2013-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多