Android : AWS Android SDK+AppCompat V7 incompatability[Android Studio]

on Saturday, March 21, 2015


In an existing application I tried including AWS S3, Core and Cognito jars [downloaded from AWS] in libs folder and added the commands in build.gradle. But trouble started with 'Top Level Exception'. I included the necessary changes for multipleDex and over 65k limit. Now the new problem is that build goes fine and apk is generated but it just fails to start [as I access v7 compat theme bar elements upon start]. I get classdefnotfound error for UI elements. I even tried maven repository based approach to include AWS jars - no luck!


Upon some trial and error - I have narrowed down the problem area. S3 and Cognito JARs are not the culprits but core JAR seems to cause problem the momement I include it in gradle file. I tried to find internal dependencies thru' gradle tasks but that didn't retun results either.


Here is the gradle file:



buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.15.2'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven {
url 'https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/'
}
}

dependencies {
//compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile project(':sugar-library')
compile 'com.google.android.gms:play-services:6.5.87'
compile 'org.apache.httpcomponents:httpmime:4.3.6'
compile 'org.apache.httpcomponents:httpcore:4.3.3'
compile 'com.path:android-priority-jobqueue:1.1.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.melnykov:floatingactionbutton:1.1.0'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.github.nkzawa:socket.io-client:0.3.0'
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
compile 'com.google.zxing:core:2.2'
compile 'com.embarkmobile:zxing-android-minimal:1.2.1@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.2.1@aar') {
transitive = true;
}
compile 'com.mixpanel.android:mixpanel-android:4.5.3'
compile 'com.konotor:KonotorActivity:3.0.4'
compile 'com.amazonaws:aws-android-sdk-core:2.1.3'
compile 'com.amazonaws:aws-android-sdk-s3:2.1.3'
}



android {
compileSdkVersion 22
buildToolsVersion "22"

dexOptions {
javaMaxHeapSize "4g"
}

defaultConfig {
applicationId "com.findulum.smartpocketapp"
minSdkVersion 14
targetSdkVersion 22
versionName "1.0.25"
versionCode 35
multiDexEnabled true
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}

lintOptions {
abortOnError false
}

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

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

0 comments:

Post a Comment