0

This project in github https://github.com/RoyWallace/Instagram

It's a android studio project,I run this project meet difficult.It can't run in mobliephone.

this is bulid.gradle(Project :Instagram-master)

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()

    }
}

build.gradle(Module:app) is this

apply plugin: 'android'

android {
    compileSdkVersion 21
    buildToolsVersion '21.1.2'

    defaultConfig {
        applicationId "etong.instagram"
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.squareup.picasso:picasso:2.3.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.android.support:support-v4:21.0.3'
}

run with error

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
     d:\Android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output C:\Users\dell\Desktop\mobliegamelive\somecode\Instagram-master\app\build\intermediates\dex\debug --input-list=C:\Users\dell\Desktop\mobliegamelive\somecode\Instagram-master\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
     2
Output:
     UNEXPECTED TOP-LEVEL EXCEPTION:
     com.android.dex.DexException: Multiple dex files define Landroid/support/v4/widget/DrawerLayout;
          at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
          at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
          at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
          at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
          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)

why this happen? how can i solve it? Any help will be appreciated

bell
  • 3
  • 3

1 Answers1

0

You have problem with support−v۴ library ! see these links maybe help you :
Android Dex: UNEXPECTED TOP-LEVEL EXCEPTION: Already added Android Studio - UNEXPECTED TOP-LEVEL EXCEPTION: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException

Community
  • 1
  • 1
YFeizi
  • 1,498
  • 3
  • 28
  • 50