javaandroidandroid-gradle-plugingoogle-project-tango

Unable to merge Dex in Android Studio 3.0


I'm a beginner with Android Studio.

Every time I try running my app on my Google Tango tablet, the following error emerges:

Execution failed for task:':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchibeMergerException: Unable to merge dex

This is my app Module build.gradle file...

    apply plugin: 'com.android.application'

    android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.cs15yyo.myfyp"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        //multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.google.tango:sdk-base:1.55'
    compile 'com.google.tango:support-base:1.54'
    compile 'com.google.tango:sdk-depth-interpolation:1.55'
    compile 'com.google.tango:sdk-transform-helpers:1.55'
    compile 'org.rajawali3d:rajawali:1.1.668@aar'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation project(':tango_support_java_lib')
    implementation project(':tango_ux_support_library')
}

This is my Project build.gradle file...

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

This is my tango_support_java_lib Module build.gradle file...

configurations.maybeCreate("default")
artifacts.add("default", file('tango_support_java_lib.aar'))

This is my tango_ux_support_library Module build.gradle file...

configurations.maybeCreate("default")
artifacts.add("default", file('tango_ux_support_library.aar'))

Attempted Solutions

Looking at existing solutions in StackOverFlow, I've tried the following....

All have failed me, annoyingly so.

This is for my work on my final year Computer Science project.


Solution

  • I've solved the issue, as it turns out, the cause of the problem was importing JAR/AAR files as libraries AFTER writing the necessary dependencies (in the module build.gradle file) to get the same libraries; therefore, after removing the JAR/AAR files, my app was able to run