2016-04-29 77 views
0

我按照本教程https://github.com/ologic/Tango/wiki/Getting-Started-with-Tango-and-ROS導入項目。找不到方法multiDexEnabled()參數[true]

當我試圖讓與catkin_make的項目,我有這樣的錯誤:

UNEXPECTED TOP-LEVEL EXCEPTION: 
com.android.dex.DexException: Multiple dex files define Lorg/ros/android/MessageCallable; 
    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:

task wrapper(type: Wrapper) { 
gradleVersion = '1.11' 
} 

buildscript { 
    def rosMavenPath = "$System.env.ROS_MAVEN_PATH".split(':').collect  { 'file://' + it } 
    def rosMavenRepository = "$System.env.ROS_MAVEN_REPOSITORY" 
    repositories { 
     rosMavenPath.each { p -> 
      maven { 
       url p 
      } 
     } 
     mavenLocal() 
     maven { 
      url rosMavenRepository 
     } 
    } 
    dependencies { 
     classpath group: 'org.ros.rosjava_bootstrap', name: 'gradle_plugins', version: '[0.1,0.2)' 
    } 
} 

apply plugin: 'catkin' 

allprojects { 
    group 'com.github.rosjava.android_extras' 
    version = project.catkin.pkg.version 
} 

subprojects { 
    apply plugin: 'ros-android' 
} 

和子項目的的build.gradle這對問題:

dependencies { 
    compile 'org.ros.android_core:android_gingerbread_mr1:[0.1,)' 
    compile 'org.ros.android_core:android_acm_serial:[0.1,)' 
    compile 'com.github.rosjava.rosjava_extras:hokuyo:[0.1,)' 
} 

apply plugin: 'android' 

android { 
    packagingOptions { 
    /* https://github.com/rosjava/android_core/issues/194 */ 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
    } 
    compileSdkVersion 13 

} 

請,有人能幫助我嗎? (對不起,我的英文很差)

+0

的可能的複製[搖籃DSL方法未找到: 'multiDexEnabled()'(https://stackoverflow.com/questions/26908228/gradle-dsl-method-not-found-multidexenabled) –

回答

-2

把它添加到你的應用程序gradle文件的android部分。

android{ 
    defaultConfig { 
      //other detail like version name ,application id etc; 
      multiDexEnabled true 
     } 
} 
+3

謝謝,我已經試過這個問題沒有結果。沒有這個,我有一個 意外的頂級例外: 和惠特我有: 無法找到方法multiDexEnabled()的參數[真] –

相關問題