Mar*_*tox 26 android build gradle android-studio build.gradle
当我尝试编译代码时,Android Studio 3.0.1上会出现以下错误
Error:Program type already present: com.squareup.picasso.Action$RequestWeakReference
Run Code Online (Sandbox Code Playgroud)
我的gradle代码:
...
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:support-vector-drawable:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-ads:11.8.0'
compile 'com.google.gms:google-services:3.1.0'
compile 'com.google.android.gms:play-services:11.8.0'
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
如何修复我的gradle脚本以修复错误?
Mel*_*lad 15
将其添加到模块build.gradle文件中
configurations.all {exclude group: 'com.android.support', module: 'support-v13'}
Run Code Online (Sandbox Code Playgroud)
小智 6
我遇到了同样的问题,所以我将分享对我有用的解决方案.我的错误是:
Program type already present: org.json.CDL
它在我将grara文件添加到gradle文件后开始出现.所以解决方案是添加这样的acra:
compile('ch.acra:acra:4.5.0') {
exclude group: 'org.json'
}
Run Code Online (Sandbox Code Playgroud)
所以在OP的情况下,解决方案是找到他的哪个依赖项已经编译了com.squareup.picasso并在上面的代码中排除.
| 归档时间: |
|
| 查看次数: |
37928 次 |
| 最近记录: |