2016-01-20 50 views
0

時出現錯誤我正在運行Android Studio,並且我的應用程序一直運行良好,直到我將以下依賴項添加到我的gradle文件中:Gradle Compilation在添加'com.amazonaws:aws-android-sdk-core:2.2。+'

Note: Some input files use or override a deprecated API. 
Note: com.google.android.gms.internal.zzlh accesses a declared method 'getInstance()' dynamically 
    Maybe this is program method 'android.support.design.widget.SnackbarManager { android.support.design.widget.SnackbarManager getInstance(); }' 
    Maybe this is program method 'android.support.v4.content.SharedPreferencesCompat$EditorCompat { android.support.v4.content.SharedPreferencesCompat$EditorCompat getInstance(); }' 
    Maybe this is program method 'android.support.v4.text.BidiFormatter { android.support.v4.text.BidiFormatter getInstance(); }' 
    Maybe this is program method 'android.support.v7.app.TwilightCalculator { android.support.v7.app.TwilightCalculator getInstance(); }' 
    Maybe this is program method 'com.amazonaws.metrics.MetricCollector$Factory { com.amazonaws.metrics.MetricCollector getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitoidentity.model.transform.CredentialsJsonUnmarshaller { com.amazonaws.services.cognitoidentity.model.transform.CredentialsJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitoidentity.model.transform.GetCredentialsForIdentityResultJsonUnmarshaller { com.amazonaws.services.cognitoidentity.model.transform.GetCredentialsForIdentityResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitoidentity.model.transform.GetIdResultJsonUnmarshaller { com.amazonaws.services.cognitoidentity.model.transform.GetIdResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitoidentity.model.transform.GetOpenIdTokenResultJsonUnmarshaller { com.amazonaws.services.cognitoidentity.model.transform.GetOpenIdTokenResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.DatasetJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.DatasetJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.DeleteDatasetResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.DeleteDatasetResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.DescribeDatasetResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.DescribeDatasetResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.ListDatasetsResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.ListDatasetsResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.ListRecordsResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.ListRecordsResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.RecordJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.RecordJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.RegisterDeviceResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.RegisterDeviceResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.SubscribeToDatasetResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.SubscribeToDatasetResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.UnsubscribeFromDatasetResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.UnsubscribeFromDatasetResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.cognitosync.model.transform.UpdateRecordsResultJsonUnmarshaller { com.amazonaws.services.cognitosync.model.transform.UpdateRecordsResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.AttributeDefinitionJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.AttributeDefinitionJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.AttributeValueJsonMarshaller { com.amazonaws.services.dynamodbv2.model.transform.AttributeValueJsonMarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.AttributeValueJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.AttributeValueJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.BatchGetItemResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.BatchGetItemResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.BatchWriteItemResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.BatchWriteItemResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.CapacityJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.CapacityJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.ConsumedCapacityJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.ConsumedCapacityJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.CreateTableResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.CreateTableResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.DeleteItemResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.DeleteItemResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.DeleteRequestJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.DeleteRequestJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.DeleteTableResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.DeleteTableResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.DescribeTableResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.DescribeTableResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.GetItemResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.GetItemResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.GlobalSecondaryIndexDescriptionJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.GlobalSecondaryIndexDescriptionJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.ItemCollectionMetricsJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.ItemCollectionMetricsJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.KeySchemaElementJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.KeySchemaElementJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.KeysAndAttributesJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.KeysAndAttributesJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.ListTablesResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.ListTablesResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.LocalSecondaryIndexDescriptionJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.LocalSecondaryIndexDescriptionJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.ProjectionJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.ProjectionJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.ProvisionedThroughputDescriptionJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.ProvisionedThroughputDescriptionJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.PutItemResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.PutItemResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.PutRequestJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.PutRequestJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.QueryResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.QueryResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.ScanResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.ScanResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.StreamSpecificationJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.StreamSpecificationJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.TableDescriptionJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.TableDescriptionJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.UpdateItemResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.UpdateItemResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.UpdateTableResultJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.UpdateTableResultJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.dynamodbv2.model.transform.WriteRequestJsonUnmarshaller { com.amazonaws.services.dynamodbv2.model.transform.WriteRequestJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.s3.util.Mimetypes { com.amazonaws.services.s3.util.Mimetypes getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.securitytoken.model.transform.AssumeRoleResultStaxUnmarshaller { com.amazonaws.services.securitytoken.model.transform.AssumeRoleResultStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.securitytoken.model.transform.AssumeRoleWithWebIdentityResultStaxUnmarshaller { com.amazonaws.services.securitytoken.model.transform.AssumeRoleWithWebIdentityResultStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.securitytoken.model.transform.AssumedRoleUserStaxUnmarshaller { com.amazonaws.services.securitytoken.model.transform.AssumedRoleUserStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.securitytoken.model.transform.CredentialsStaxUnmarshaller { com.amazonaws.services.securitytoken.model.transform.CredentialsStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.securitytoken.model.transform.FederatedUserStaxUnmarshaller { com.amazonaws.services.securitytoken.model.transform.FederatedUserStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.securitytoken.model.transform.GetFederationTokenResultStaxUnmarshaller { com.amazonaws.services.securitytoken.model.transform.GetFederationTokenResultStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.services.securitytoken.model.transform.GetSessionTokenResultStaxUnmarshaller { com.amazonaws.services.securitytoken.model.transform.GetSessionTokenResultStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$BigDecimalJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$BigDecimalJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$BigIntegerJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$BigIntegerJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$BooleanJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$BooleanJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$ByteBufferJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$ByteBufferJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$ByteJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$ByteJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$DateJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$DateJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$DoubleJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$DoubleJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$FloatJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$FloatJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$IntegerJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$IntegerJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$LongJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$LongJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeJsonUnmarshallers$StringJsonUnmarshaller { com.amazonaws.transform.SimpleTypeJsonUnmarshallers$StringJsonUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeStaxUnmarshallers$BigDecimalStaxUnmarshaller { com.amazonaws.transform.SimpleTypeStaxUnmarshallers$BigDecimalStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeStaxUnmarshallers$BigIntegerStaxUnmarshaller { com.amazonaws.transform.SimpleTypeStaxUnmarshallers$BigIntegerStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeStaxUnmarshallers$BooleanStaxUnmarshaller { com.amazonaws.transform.SimpleTypeStaxUnmarshallers$BooleanStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeStaxUnmarshallers$ByteBufferStaxUnmarshaller { com.amazonaws.transform.SimpleTypeStaxUnmarshallers$ByteBufferStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeStaxUnmarshallers$ByteStaxUnmarshaller { com.amazonaws.transform.SimpleTypeStaxUnmarshallers$ByteStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeStaxUnmarshallers$DateStaxUnmarshaller { com.amazonaws.transform.SimpleTypeStaxUnmarshallers$DateStaxUnmarshaller getInstance(); }' 
    Maybe this is program method 'com.amazonaws.transform.SimpleTypeStaxUnmarshallers$DoubleStaxUnmarshaller { com.amazonaws.transform.SimpleTypeStaxUnmarshallers$DoubleStaxUnmarshaller getInstance(); }' 
Preparing output jar [F:\IcyGo-v2.6\app\build\intermediates\multi-dex\debug\componentClasses.jar] 


Copying resources from program jar [F:\IcyGo-v2.6\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar] 
:app:transformClassesWithDexForDebug 
UNEXPECTED TOP-LEVEL ERROR: 
java.lang.OutOfMemoryError: GC overhead limit exceeded 
    at com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:371) 
    at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262) 
    at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:323) 
    at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:309) 
    at com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150) 
    at com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124) 
    at com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115) 
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482) 
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) 
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388) 
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251) 
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764) 
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85) 
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684) 
    at com.android.dx.command.dexer.Main.processClass(Main.java:749) 
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718) 
    at com.android.dx.command.dexer.Main.access$1200(Main.java:85) 
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645) 
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) 
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) 
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) 
    at com.android.dx.command.dexer.Main.processOne(Main.java:672) 
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:569) 
    at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366) 
    at com.android.dx.command.dexer.Main.run(Main.java:275) 
    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:transformClassesWithDexForDebug'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 3 

這裏是我的完整gradle.build文件(應用級):

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    useLibrary 'org.apache.http.legacy' 

    defaultConfig { 
     applicationId "com.myapp.myapp" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "31.0" 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile project(':swipelistview') 

    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile 'com.android.support:support-v4:23.1.1' 
    compile 'com.google.android.gms:play-services-base:6.5.87' 
    compile 'com.github.nkzawa:socket.io-client:0.3.0' 
    compile 'com.google.android.gms:play-services:8.4.0' 
    compile 'com.google.android.gms:play-services-location:7.5.0' 
    compile 'com.github.amlcurran.showcaseview:library:5.0.0' 
    compile 'com.baoyz.swipemenulistview:library:1.3.0' 
    compile 'com.github.orangegangsters:swipy:[email protected]' 
    compile 'com.makeramen:roundedimageview:2.2.1' 
    compile 'com.google.android.gms:play-services-cast:7.5.0' 

    compile 'com.amazonaws:aws-android-sdk-core:2.2.+' 
    compile 'com.amazonaws:aws-android-sdk-cognito:2.2.+' 
    compile 'com.amazonaws:aws-android-sdk-s3:2.+' 
    compile 'com.amazonaws:aws-android-sdk-ddb:2.+' 
} 
compile 'com.amazonaws:aws-android-sdk-core:2.2.+' 
compile 'com.amazonaws:aws-android-sdk-cognito:2.2.+' 
compile 'com.amazonaws:aws-android-sdk-s3:2.+' 
compile 'com.amazonaws:aws-android-sdk-ddb:2.+ 

這些重建項目時造成下列警告10

我認爲這個問題是由於使用'com.google.android.gms:play-services:8.4.0',因爲他們使用的演示項目是'com.google.android.gms:play-services:6.1.+',並且演示項目運行良好。

事情是,我不能降級我的應用程序使用'com.google.android.gms:play-services:6.1.+'

任何建議或幫助在這個問題上高度讚賞。

回答

0

感謝上帝,我最終找到了解決方案。錯誤背後的原因是GC overhead limit exceeded Amazon AWS庫包含大量的方法,在編譯時會導致java.lang.OutOfMemoryError。 解決的辦法是

dexOptions { 
    javaMaxHeapSize "4g" 
} 

defaultConfig { 
    applicationId "com.example.app" 
    minSdkVersion 15//use any version as needed by you 
    targetSdkVersion 23//use any version as needed by you 
    versionCode 1//your own version code 
    versionName "1.0"//your own versionName 
    multiDexEnabled true//required 


} 

添加到您的應用級的build.gradle文件。