Facebook - 顶级水平例外

时间:2013-12-30 23:16:27

标签: java android facebook android-studio

如果您需要查看其他任何内容,请与我们联系。

我将Facebook添加到我的项目中。我正在使用Android工作室。构建后我的错误是:

 Execution failed for task ':king:dexDebug'.
     

com.android.ide.common.internal.LoggedErrorException:无法运行命令:       /Users/chad.bingham/Documents/sdk/build-tools/19.0.1/dx --dex --output /Users/chad.bingham/Development/Android/KingoftheCard/king/build/libs/king-debug.dex /Users/chad.bingham/Development/Android/KingoftheCard/king/build/classes/debug/Users/chad.bingham/Development/Android/KingoftheCard/king/build/dependency-cache/debug /Users/chad.bingham/Development /Android/KingoftheCard/king/build/pre-dexed/debug/android-support-v4-e2aa3ac97d06a6c260b9e7a8e8b5b67b​​edf586a1.jar/Users/chad.bingham/Development/Android/KingoftheCard/king/build/pre-dexed/debug/classes-77e2a94f0954846e61795cd81b4927c70f7ddd34 .jar /Users/chad.bingham/Development/Android/KingoftheCard/king/build/pre-dexed/debug/classes-dca0b79a4b1578f641fd0837fba5826a05b82bf3.jar/Users/chad.bingham/Development/Android/KingoftheCard/king/build/pre-dexed /debug/Parse-1.3.9-9d5a3b199ec45c97e80ea5dccd8d494dd1434a38.jar/Users/chad.bingham/Development/Android/KingoftheCard/king/build/pre-dexed/debug/support-v4-19.0.0-22fbcf9fc92c2104fe5528ed103 8f864952f9cf3.jar     错误代码:       2     输出:       意外的顶级例外情况:       com.android.dex.DexException:多个dex文件定义了Landroid / support / v4 / accessibilityservice / AccessibilityServiceInfoCompat $ AccessibilityServiceInfoVersionImpl;           在com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)           在com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)           在com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)           在com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)           在com.android.dx.merge.DexMerger.merge(DexMerger.java:188)           在com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)           在com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)           在com.android.dx.command.dexer.Main.run(Main.java:230)           在com.android.dx.command.dexer.Main.main(Main.java:199)           在com.android.dx.command.Main.main(Main.java:103)

修改

项目build.gradle

 buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android'

repositories {
mavenCentral()
}

android {
     compileSdkVersion 19
     buildToolsVersion '19.0.1'

   defaultConfig {
      minSdkVersion 7
        targetSdkVersion 19
       versionCode 1
      versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
 }

dependencies {
   compile 'com.android.support:appcompat-v7:19.0.0'
   compile files('libs/Parse-1.3.9.jar')
   compile project(':libraries:facebook')
 }

Facebook build.gradle

 buildscript {
 repositories {
     maven { url 'http://repo1.maven.org/maven2' }
  }
   dependencies {
     classpath 'com.android.tools.build:gradle:0.7.0+'
    }
 }

 apply plugin: 'android-library'

 dependencies {
     compile 'com.android.support:appcompat-v7:19.0.0'
 }

 android {
  compileSdkVersion 19
  buildToolsVersion "19.0.1"

  defaultConfig {
    minSdkVersion 7
      targetSdkVersion 19
  }

  sourceSets {
      main {
          manifest.srcFile 'AndroidManifest.xml'
          java.srcDirs = ['src']
           resources.srcDirs = ['src']
           res.srcDirs = ['res']
       }
    }
 }

1 个答案:

答案 0 :(得分:0)

Found solution here。最初它没有用,所以我不得不做文件>使高速缓存/重新启动无效