- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我在使用 Android Studio 的 Android 应用上尝试使用 Google Play 服务时遇到了问题。
我已经尝试了所有方法,但仍然无法正常工作。
这是错误。
Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Users/jghg/Desktop/My App/Android/SDK/android-sdk-mac_86/build-tools/19.0.1/dx --dex --output /Users/jghg/Desktop/My App/Eureka/UDA/app/build/libs/app-debug.dex /Users/jghg/Desktop/My App/Eureka/UDA/app/build/classes/debug /Users/jghg/Desktop/My App/Eureka/UDA/app/build/dependency-cache/debug /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/classes-08979151dd1373bd3f799299d93376d22d4afa46.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/classes-167b9d3c5d689abe004c3fa5b0bcb945d3f0fc8e.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/google-play-services-ec20f8af7bb457c5095cae1afa0cee722582f198.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/support-v4-13.0.0-473d85b8d55c88bfed3404072e6c132f96543429.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/support-v4-19.0.1-861cc05365a0e9262c764da37d61e3f93dc16de6.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/support-v4-19.0.1-dcc11377c764caea791f711123b8b678f876c3b6.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/twitter4j-async-3.0.5-0904cb320186fb23a9a9bf25a048c5bc4ec07bc2.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/twitter4j-core-3.0.5-41d2d5805e2d90cf77813a126306c4cbe22583ae.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/twitter4j-examples-3.0.5-adc1ee9b037c8061429560e6a5fe89ce8e502db6.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/twitter4j-media-support-3.0.5-37d138cdc631738d13ddb6f4d34c560a9cd8e048.jar /Users/jghg/Desktop/My App/Eureka/UDA/app/build/pre-dexed/debug/twitter4j-stream-3.0.5-c96c138ea216b25631a1a8b47520ecaf33f288d8.jar Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) at com.android.dx.merge.DexMerger.merge(DexMerger.java:188) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) at com.android.dx.command.dexer.Main.run(Main.java:230) at com.android.dx.command.dexer.Main.main(Main.java:199) at com.android.dx.command.Main.main(Main.java:103)
谢谢。此致。
最佳答案
当您在 build.gradle 的依赖项中多次包含相同的库/目录时会发生错误。好的,假设您有一个如下所示的 App 结构:
所以你有主“应用程序”,然后你有一堆子应用程序/模块/库。这些库是:1) gene_test_library
、2) genes_nine_old_androids_library
和 3) swipe_list_view_library
。
我的名字是 Gene,这就是为什么会有所有这些“基因”库的原因。
在 “app”
的 build.gradle
中,我有:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.0'
compile project(':libraries:gene_test_library')
//compile project(':libraries:genes_nine_old_androids_library')
compile project(':libraries:swipe_list_view_library')
}
在 gene_test_library
的 build.gradle
中,我什么都没有:
dependencies {
}
在 gene_nine_old_androids_library
的 build.gradle
中,我有:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
}
在 swipe_list_view_library
的 build.gradle
中,我有:
dependencies {
compile 'com.nineoldandroids:library:2.4.0+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
}
这行代码compile fileTree(dir: 'libs', include: ['*.jar'])
只是表示“嘿,看看这个模块内的'libs'文件夹里面有什么jar 文件。我在任何模块的 libs 文件夹中都没有任何内容,因此您可以忽略该行代码。
假设我取消注释 //compile project(':libraries:genes_nine_old_androids_library')
在 “app”
模块的 build.gradle
中。然后我会得到 “UNEXPECTED TOP-LEVEL EXCEPTION:”
错误。这是为什么?
好吧,在 “app”
的 build.gradle
中编写 //compile project(':libraries:genes_nine_old_androids_library')
是与获取 “genes_nine_old_androids_library”
模块的构建依赖项并将其放在那里相同。因此取消注释 //compile project(':libraries:genes_nine_old_androids_library')
语句,“app”模块的 build.gradle
变为:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.0'
compile project(':libraries:gene_test_library')
***compile fileTree(dir: 'libs', include: ['*.jar'])***
***compile 'com.android.support:appcompat-v7:21.0.0'***
compile project(':libraries:swipe_list_view_library')
}
注意现在 compile 'com.android.support:appcompat-v7:21.0.0'
如何显示 2x。这就是错误的来源。
关于java - 意外的顶级异常 : com. android.dex.DexException:多个 dex 文件定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22468700/
我有一个用于重构练习的测试套件,我希望它与 Data.List 兼容。和 Data.List.NonEmpty .练习包含一个函数 foo :: [Foo] -> Foo并且测试套件有一些 data
我下载了 Android Studio 项目。项目根目录只有一个 build.gradle 具有下一个结构: apply plugin: 'com.android.library' android {
我似乎无法正确使用最接近的函数来删除删除按钮之外的 UL。 HTML X Data Jquery $('.remove').click(function(){
我需要一些帮助。顶级 Activity 必须位于自定义包之外吗?这样的话,MainActivity应该是在自定义包之外吧?Activity 是自定义包名称。
我正在尝试使用 AppCompat Drawer 和多个顶级 Activity (不是 fragment )创建一个基本应用程序 - 我不太清楚如何管理后台堆栈 - 我已经尝试了大约一百种不同的方法-
无法找到任何相关信息,我可以自己完成此操作,但我觉得将其保留在查询中可能是最好的选择(如果可能的话)。 基本上我想尝试添加查询的顶级“统计”部分。 所以当我得到结果时,我会看到这样的结果 num_ro
我在菜单中遇到 onmouseout/over delay 问题。我发现通过将 setTimeout 数字从 100 更改为 2000,它延迟了顶层菜单的隐藏而不是子级菜单,并且在新的 onmouse
是否有一个选项可以通过使用动画在运行时简单地 move Tkinter TopLevel() 窗口?我想到了由按钮触发的平滑 moveInAnimation。 这是一些代码片段: from Tkint
我从正在调用的 API 中获取了以下 JSON 文件: { "14500": [ { "5": { "versionName": "VersionOne",
在 C++ Primer 第五版中,它说: int f(int){ /* can write to parameter */} int f(const int){ /* cannot write to
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我正在使用 Retrofit 进行一些 API 调用。对于特定端点,返回的 json 看起来有点像这样: 端点:api.example.com/1.0/userinfo?userid=7 返回的响应看
假设我有一个 Python 文件,我想在顶层运行它,但在它完成后,我想从它停止的地方继续。我希望能够使用它创建的对象等。 一个简单的例子,假设我有一个执行 i = 5 的 Python 脚本。当脚本结
我在 Xcode 中使用 Cmake 来生成一个 c++/c“项目”(my_project) 和一些 c++/c“目标”(一个是二进制文件,其余是库) 我的 CMakeLists.txt 看起来像这样
我正在尝试学习 redux,但遇到了错误。我只有两个文件,一个 index.html 文件和一个 main.js 文件,html 文件中有指向 jquery 和 redux cdns 的链接。我在 r
我有这个通用函数可以保存在 NSUserDefaults 中,通常可以正常工作,但现在我想保存一个 boolean 值,但出现错误。我找不到任何东西,我不明白为什么它不起作用。 extension U
我正在使用 Retrofit 进行 API 调用。顶级对象的命名取决于请求的查询参数。例如,这样的请求: api.somewebsite.com/1.0/mix_info?mix_id=69 返回这样
我做汤: from bs4 import BeautifulSoup soup = BeautifulSoup("My paragraph My link", "html.parser") 我想删除第
看完new egghead course由 Dan Abramov 撰写,我对提到的选择器有疑问。 选择器的目的是向组件隐藏状态树的详细信息,以便在树发生变化时便于以后管理代码。 如果我理解正确,那意
我是一名优秀的程序员,十分优秀!