-1

I'm trying to install aws on android studio with [add library dependency]
on [project structure->app->dependencies->+]
now i choose:
com.amazonaws:aws-java-sdk:1.9.8
Then I'm trying to start my android application but this error appears:

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536

Now I'm trying this solution:

android {
   defaultConfig {
      ...
      multiDexEnabled = true
   }
}

(on this site: Unable to execute dex: method ID not in [0, 0xffff]: 65536)

But then this error appears:

same fail but this time this line appears too:

Deprecated dynamic property: "multiDexEnabled" on 

"ProductFlavorDsl_Decorated{name=main, minSdkVersion=ApiVersionImpl{mApiLevel=14, mCodename='null'}, targetSdkVersion=ApiVersionImpl{mApiLevel=20, mCodename='null'}, renderscriptTargetApi=-1, renderscriptSupportMode=null, renderscriptNdkMode=null, versionCode=1, versionName=1.0, applicationId=com.example.matthias.booksearch, testApplicationId=null, testInstrumentationRunner=null, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null}", value: "true".

I think the problem is something with gradle, because of Build Failure... My dependencies of gradle.build are:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.amazonaws:aws-java-sdk:1.9.8'
}

If someone use the aws-framework and it works, please write me back how you get started with it.

Community
  • 1
  • 1
mzober
  • 91
  • 7

3 Answers3

1

In your build.gradle file add multiDexEnabled true to defaultConfig and compile 'com.android.support:multidex:1.0.0' to your dependencies.

defaultConfig {

    ...
    multiDexEnabled true
}

dependencies {
    ...
    compile 'com.android.support:multidex:1.0.0'

}

Also, make sure you are using the latest stable version of Android Studio 1.0.1 from the Stable Channel.

https://developer.android.com/tools/building/multidex.html

daniribalbert
  • 377
  • 4
  • 10
0

multiDexEnabled support was added in v0.14.0 of the Android Gradle plugin, according to the release notes:

http://tools.android.com/tech-docs/new-build-system

It's not supported in 0.12.2, which is what you're running.

Please update to using the latest version of the plugin. You may need to update Android Studio to the latest version as well.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163
0

I have updated my gradle to 1.0.0 now I can configure multiDexEnable=true,
this solves the Dex error, but now I am trying to add 2 librarys:

aws-android-sdk-2.1.5-sdb.debug ,

aws-android-sdk-2.1.5-sdb and com.amazonaws:aws-java-sdk-core:1.9.9

(last One as maven dependencies)

and trying to run my Application with some simpleDB code, but now this error appears:

Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
`> java.util.zip.ZipException: duplicate entry: 
com/amazonaws/services/simpledb/AmazonSimpleDB.class

Some Solutions?

mzober
  • 91
  • 7