2015-12-15 46 views
-1

我gradle这个文件中的代码是在这里。错误Android Studio中的图书馆没有解决意外顶级例外:

apply plugin: 'com.android.application' android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
     applicationId "com.preciseit.trackusdown" 
     minSdkVersion 14 
     targetSdkVersion 23 


    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } } dependencies { 
    compile files('libs/activation.jar') 
    compile files('libs/additionnal.jar') 
    compile files('libs/ksoap2-android-assembly-2.5.8-jar-with-dependencies.jar') 
    compile files('libs/mail.jar') 
    compile project(":library") // compile project(":backend") // compile 'com.nineoldandroids:library:2.4.0' 


    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:support-v4:23.1.1' 
    //compile 'com.daimajia.androidanimations:library:[email protected]' 
    compile 'com.android.support:recyclerview-v7:23.1.1' 
    compile 'com.google.android.gms:play-services:8.1.0' 
    compile 'com.squareup.retrofit:retrofit:1.9.0' 
    compile 'com.loopj.android:android-async-http:1.4.9' // compile 'com.squareup.picasso:picasso:2.5.2' 
    //compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.1' 

} 

错误是:

Information:Gradle tasks 
[:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug] :app:preBuild 
UP-TO-DATE :app:preDebugBuild 
UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild 
UP-TO-DATE :library:compileLint :library:copyReleaseLint 
UP-TO-DATE :library:preBuild 
UP-TO-DATE :library:preReleaseBuild 
UP-TO-DATE :library:checkReleaseManifest :library:preDebugAndroidTestBuild 
UP-TO-DATE :library:preDebugBuild 
UP-TO-DATE :library:preDebugUnitTestBuild 
UP-TO-DATE :library:preReleaseUnitTestBuild 
UP-TO-DATE :library:prepareComAndroidSupportSupportV42221Library 
UP-TO-DATE :library:prepareReleaseDependencies :library:compileReleaseAidl \n 
UP-TO-DATE :library:compileReleaseRenderscript 
UP-TO-DATE :library:generateReleaseBuildConfig 
UP-TO-DATE :library:generateReleaseAssets 
UP-TO-DATE :library:mergeReleaseAssets 
UP-TO-DATE :library:generateReleaseResValues 
UP-TO-DATE :library:generateReleaseResources 
UP-TO-DATE :library:mergeReleaseResources 
UP-TO-DATE :library:processReleaseManifest 
UP-TO-DATE :library:processReleaseResources 
UP-TO-DATE :library:generateReleaseSources 
UP-TO-DATE :library:processReleaseJavaRes 
UP-TO-DATE :library:compileReleaseJavaWithJavac 
UP-TO-DATE :library:extractReleaseAnnotations 
UP-TO-DATE :library:mergeReleaseProguardFiles 
UP-TO-DATE :library:packageReleaseJar 
UP-TO-DATE :library:compileReleaseNdk 
UP-TO-DATE :library:packageReleaseJniLibs 
UP-TO-DATE :library:packageReleaseLocalJar 
UP-TO-DATE :library:packageReleaseRenderscript 
UP-TO-DATE :library:packageReleaseResources 
UP-TO-DATE :library:bundleRelease 
UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72311Library 
UP-TO-DATE :app:prepareComAndroidSupportMediarouterV72220Library 
UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72311Library 
UP-TO-DATE :app:prepareComAndroidSupportSupportV42311Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServices810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppstate810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBasement810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCast810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesDrive810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesFitness810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGames810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesLocation810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMaps810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesNearby810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPanorama810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesVision810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWallet810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWearable810Library 
UP-TO-DATE :app:prepareTrackerFinalLibraryUnspecifiedLibrary 
UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl 
UP-TO-DATE :app:compileDebugRenderscript 
UP-TO-DATE :app:generateDebugBuildConfig 
UP-TO-DATE :app:generateDebugAssets 
UP-TO-DATE :app:mergeDebugAssets 
UP-TO-DATE :app:generateDebugResValues 
UP-TO-DATE :app:generateDebugResources 
UP-TO-DATE :app:mergeDebugResources 
UP-TO-DATE :app:processDebugManifest 
UP-TO-DATE :app:processDebugResources 
UP-TO-DATE :app:generateDebugSources 
UP-TO-DATE :app:preDebugAndroidTestBuild 
UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl 
UP-TO-DATE :app:processDebugAndroidTestManifest 
UP-TO-DATE :app:compileDebugAndroidTestRenderscript 
UP-TO-DATE :app:generateDebugAndroidTestBuildConfig 
UP-TO-DATE :app:generateDebugAndroidTestAssets 
UP-TO-DATE :app:mergeDebugAndroidTestAssets 
UP-TO-DATE :app:generateDebugAndroidTestResValues 
UP-TO-DATE :app:generateDebugAndroidTestResources 
UP-TO-DATE :app:mergeDebugAndroidTestResources 
UP-TO-DATE :app:processDebugAndroidTestResources 
UP-TO-DATE :app:generateDebugAndroidTestSources 
UP-TO-DATE :app:processDebugJavaRes 
UP-TO-DATE :app:compileDebugJavaWithJavac 
UP-TO-DATE :app:compileDebugNdk 
UP-TO-DATE :app:compileDebugSources 
UP-TO-DATE :app:preDexDebug warning: Ignoring InnerClasses attribute for an anonymous inner class 

(org.ksoap2.transport.KeepAliveHttpsTransportSE$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an 
UP-TO-DATE compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. :app:dexDebug 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:502) 
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334) 
at com.android.dx.command.dexer.Main.run(Main.java:277)  
at com.android.dx.command.dexer.Main.main(Main.java:245)  
at com.android.dx.command.Main.main(Main.java:106) Error:Execution failed for task ':app:dexDebug'. 

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2 Information:BUILD FAILED Information:Total time: 
50.233 secs Information:1 error Information:0 warnings Information:See complete output in console 
+0

为了更好的交流请加一些细节..! – AndiGeeky

+0

的可能的复制[如何启用全新的Android Multidex支持库multidexing(http://stackoverflow.com/questions/26609734/how-to-enable-multidexing-with-the-new-android-multidex-support-库) –

+0

Himashhu我尝试了..还是同样的错误...... –

回答

1

你有multidex文件的问题,所以请在下面的依赖添加到您的应用摇篮文件。

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

也加入这一行:

defaultConfig { 

    applicationId 'pkg' 
    minSdkVersion 
    targetSdkVersion 
    versionCode 
    versionName 

    // Enable MultiDexing: https://developer.android.com/tools/building/multidex.html 
    multiDexEnabled true 
} 

还要添加下面的Manifest.xml:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.android.multidex.myapplication"> 
    <application 
     ... 
     android:name="android.support.multidex.MultiDexApplication"> 
     ... 
    </application> 
</manifest> 

编辑:

尝试以下操作:

  1. 改变设置

按Ctrl + Alt + S - >编译器 - >摇篮

INVM选项字段写:

-Xmx2048m -XX:MaxPermSize参数=512米

  • 添加的gradle中
  • dexOptions { javaMaxHeapSize “2G” }

    谢谢..!

    +0

    我试图it..not工作 –

    +0

    @Ravindra帕瓦尔:检查编辑答案.. !! – AndiGeeky

    相关问题