ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

RosActivity with Google Maps Android API, UNEXPECTED TOP-LEVEL EXCEPTION

asked 2015-12-14 14:21:14 -0500

Christoph0000 gravatar image

Hi all.

I trying to use an activity which uses the Google Maps Android API alongside with a RosActivity. But I end up with an error like this:

Error:Execution failed for task ':maps:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/home/cburger/Android/Sdk/build-tools/21.1.2/dx --dex --output /home/cburger/myandroid/src/android_foo/maps/build/intermediates/dex/debug --input-list=/home/cburger/myandroid/src/android_foo/maps/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
    at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
    at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
    at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)

I tried to solve it by adding

defaultConfig {
    ....
    multiDexEnabled = true
 }

to build.gradle according to this post, but that didn't work and gives me this Application Installation Failed error

Installation failed with message INSTALL_FAILED_CONFLICTING_PROVIDER.

my Gradle file:

dependencies {
compile 'org.ros.android_core:android_10:[0.2,0.3)'
compile 'org.ros.android_core:android_15:[0.2,0.3)'
compile 'com.google.android.gms:play-services:8.3.0'    //used for the google maps API
compile 'com.android.support:appcompat-v7:[15.,)'         //used for the google maps API
}
apply plugin: 'com.android.application'

android {
  compileSdkVersion 23
  defaultConfig {
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled = true
  }
}

has anyone done this before or any hints on how to solve this problem?

Thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-07-09 08:06:56 -0500

Tony10012 gravatar image

updated 2016-07-09 08:57:53 -0500

gvdhoorn gravatar image

First add this to defaultConfig:

defaultConfig { 

        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        // Enabling multidex support.
        multiDexEnabled true

}

Second add this to dependencies:

dependencies{

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:24.0.0'

    compile 'com.android.support:multidex:1.0.1'

    compile 'com.github.rosjava.android_remocons:common_tools:[0.2,0.3)'
    compile 'org.ros.android_core:android_15:[0.2,0.3)'
}

That's all.

Refer to URL:

http://stackoverflow.com/questions/26...

edit flag offensive delete link more
0

answered 2016-05-20 11:25:06 -0500

James Puderer gravatar image

I think it is likely because you're are including BOTH org.ros.android_core for both Android SDK 10 and 15, which doesn't seem right to me.

You only need one. Ideally, the most recent version that you intend to support (which from your post is 15, since minSdkVersion is 15).

Including both will give you duplicate definitions of what are essentially the same classes.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2015-12-14 14:21:14 -0500

Seen: 1,046 times

Last updated: Jul 09 '16