- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
当我运行 ./gradlew assembleDebug
时,我得到:
:app:dexDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/home/grub/Main/android-sdk-linux/build-tools/19.1.0/dx --dex --num-threads=4 --output
合并类和 jar 列表:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
它与this 非常相似问题和问题应该在多个 support-v4 库中。我清理了 build.gradle
:
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 8
versionName "2.1.17"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:20.+'
compile ('com.google.android.gms:play-services:5+'){
exclude group: 'com.android.support', module: 'support-v4'
}
compile(project(':libraries:com.typefacedwidgets')) {
exclude group: 'com.android.support', module: 'support-v4'
}
compile(project(':libraries:com.truepagerindicator')) {
exclude group: 'com.android.support', module: 'support-v4'
}
compile ('com.sothree.slidinguppanel:library:+'){
exclude group: 'com.android.support', module: 'support-v4'
}
compile ('com.github.chrisbanes.pulltorefresh:sample:2.1.1+'){
exclude group: 'com.google.android', module: 'support-v4'
}
compile 'com.thoughtworks.xstream:xstream:1.4.7'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.google.code.gson:gson:2.3'
compile 'de.greenrobot:eventbus:2.2.1'
}
}
为了检查依赖关系,我做了 ./gradlew -q -dependencies
显示:
+--- com.android.support:support-v4:20.+ -> 20.0.0
| \--- com.android.support:support-annotations:20.0.0
+--- com.google.android.gms:play-services:5+ -> 5.2.08
+--- project :libraries:com.typefacedwidgets
+--- project :libraries:com.truepagerindicator
+--- com.sothree.slidinguppanel:library:+ -> 2.0.1
| \--- com.nineoldandroids:library:+ -> 2.4.0
+--- com.github.chrisbanes.pulltorefresh:sample:2.1.1+ -> 2.1.1
| +--- com.github.chrisbanes.pulltorefresh:library:2.1.1
| +--- com.github.chrisbanes.pulltorefresh:extra-listfragment:2.1.1
| | \--- com.github.chrisbanes.pulltorefresh:library:2.1.1
| \--- com.github.chrisbanes.pulltorefresh:extra-viewpager:2.1.1
| \--- com.github.chrisbanes.pulltorefresh:library:2.1.1
+--- com.thoughtworks.xstream:xstream:1.4.7
| +--- xmlpull:xmlpull:1.1.3.1
| \--- xpp3:xpp3_min:1.1.4c
+--- com.squareup.retrofit:retrofit:1.6.1
| \--- com.google.code.gson:gson:2.2.4 -> 2.3
+--- com.squareup.okhttp:okhttp-urlconnection:2.0.0
| \--- com.squareup.okhttp:okhttp:2.0.0
| \--- com.squareup.okio:okio:1.0.0
+--- com.squareup.okhttp:okhttp:2.0.0 (*)
+--- com.google.code.gson:gson:2.3
\--- de.greenrobot:eventbus:2.2.1
看起来应该没问题,但问题仍然存在。
更新:
问题出在 apkLib 依赖和来自 Gradle 的混淆消息中。它像在this中一样被解决了回答将 Android-PullToRefresh 放入 Gradle 中单独的 android 库项目中。
最佳答案
当我导入一些需要 Google Play 服务的库时出现这个错误,
我刚从:
compile 'com.google.android.gms:play-services:6.5.87'
到:
compile ('com.google.android.gms:play-services:6.5.87') {
exclude module: 'support-v4'
}
现在它构建正常
关于android - 多个dex文件用Gradle定义Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25384166/
我收到多行错误,指出它有重复的类 Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCom
我的项目昨天运行良好,今天却出现以下错误。请帮忙。 出了什么问题:无法解析配置“:app:debugCompileClasspath”的所有文件。 Could not find support-v4.
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我正在使用 react-native-webrtc 运行示例应用程序模块。我正在尝试在 android 中运行该应用程序,但出现这样的错误... * What went wrong: A probl
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我克隆了我的项目并使用 Android studio 打开,但构建失败并出现以下错误并且同一个项目在其他项目上运行良好。 出了什么问题:无法解析配置“:app:flavorUnsignedReleas
我正在运行示例应用程序......我正在使用 this模块.....但是我收到这样的错误... FAILURE: Build failed with an exception. * What went
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
添加 Android 平台(ionic cordova platform add android)后,我构建了我的 Ionic 项目(ionic cordova build android),但出现错
这个问题在这里已经有了答案: Manifest merger failed : Attribute application@appComponentFactory - Androidx (14 个答
关于我的 Gradle 文件中的以下“complie”: dependencies { compile 'com.android.support:support-v4:25.3.1' }
有些困惑。 我想更频繁地使用@supports 但是...我不关心浏览器如何看待它。希望您能说清楚,如果可以的话谢谢您。 如果浏览器本身不理解@supports,它如何计算@support 'not'
我刚刚升级到 Dart 2 和最新版本的 Flutter,现在我无法构建我的应用程序。我在互联网上环顾四周,但仍然不明白为什么会发生这种情况。 我得到的错误是: FAILURE: Build fail
我正在学习 Firebase,但由于以下错误而陷入困境: Error:Failed to resolve: com.android.support:customtabs:25.4.0 Error:Fa
我在构建本周时出于某种原因尝试使用Cordova进行项目时遇到问题: cordova build android gradle获取com.android.support:support alpha而不
对应的androidx是什么com.android.support:support-compat 的图书馆实现push notifications ? 他们说here它是 androidx 的一部分,
我正在尝试为我的应用设置插桩单元测试。并且我已根据以下开发者站点链接添加了依赖项。 https://developer.android.com/training/testing/unit-testin
当我想使用 Proguard 规则生成签名的 APK(发布)时,我收到了以下错误消息: Cannot find a version of 'com.android.support:support-an
这个问题在这里已经有了答案: Failed to resolve: com.android.support:appcompat-v7:26.0.0 (14 个答案) Failed to resolv
我是一名优秀的程序员,十分优秀!