Error [DuplicatePlatformClasses] class conflict when building release on Room persistence - android

I have used this guide to build persistence with Room in my Android App:
https://developer.android.com/training/data-storage/room/index.html
and added dependances like shown here:
https://developer.android.com/topic/libraries/architecture/adding-components.html
when i build the debug version and deply to phone, everithing works fine.
When i build the release signed APK i got this error message:
Error:Error: json defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]
my app.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
/* TODO(developer): Configure to sign app with a release key for testing.
release {
storeFile file('path/to/release/signing/key')
keyAlias 'release_key_alias'
keyPassword "${password}"
storePassword "${password}"
}*/
}
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "myappid"
minSdkVersion 14
targetSdkVersion 23
versionCode 10
versionName "1.8"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// TODO(developer): uncomment below once config above is complete and uncommented.
//signingConfig signingConfigs.release
}
}
}
configurations {
all {
exclude module: 'httpclient'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.1.0'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.nkzawa:socket.io-client:0.3.0'
compile 'io.socket:socket.io-client:0.8.3'
compile 'com.android.support:design:26.1.0'
compile 'android.arch.persistence.room:runtime:1.0.0'
implementation "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
}
my project.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
//classpath 'io.socket:socket.io-client:0.8.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
ext{
roomVersion = '1.0.0'
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}
}
Somebody can help or give me clues?

I finally found the problem was a JSON sub-module:
compile 'com.github.nkzawa:socket.io-client:0.3.0'
this library has a submodule:
org.json:json
that is now conflicting with android native module, because in my other dependancies i can't find this one. It was working fine 10 days ago.
I also had to kill this:
compile 'io.socket:socket.io-client:0.8.3'
the final solution was to add an exclude for the module and change the line like this:
implementation ('com.github.nkzawa:socket.io-client:0.3.0',{
exclude group:'org.json', module:'json'
})
I also have noticed AFTER i solved the problem that in the error log it was suggesting me the module that was in conflict but even if i read it a hundred times i didn't noticed before:
so maybe google or Intellij could improve the writing of this errors...
To spot this class duplicate conflict error module i found the best way to proceed is to create a new project and paste in the dependancies in app build.gradle, and check them one by one or with "dividi et impera", maybe this is an obvious suggestion for someone but i would have like to have it sooner.

I had the same problem and I searched for the conflict via the gradle dependency tree:
gradlew app:dependencies
Then I excluded the the json module for the conflicting library:
implementation ('<conflicting-library>',{
exclude group:'org.json', module:'json'
})

How to find the duplicate library.
open gradle run window and run such command:
gradle module-name:dependencies
the "module-name" should be your app module's name, for me, it's "osmunda-demo".
then use Ctrl+F to search "commons-logging", you'll find it.

#Romeo has suggested a really great point. Was unable to debug the code for hours. The problem lies within the dependencies that are imported in build.gradle. It may be your own custom sdk/artifact. I had issues with my own library which uses jjwt. I added the exclusion in my sdk but you will have to add it again whenever using the sdk. Make sure to add exclude group: 'org.json', module: 'json' in your artifact implementation.

Related

Program type already present: android.support.v4.app.BackStackRecord$Op

I got this error every time I try to run my android game:
Program type already present: android.support.v4.app.BackStackRecord$Op
Message{kind=ERROR, text=Program type already present: android.support.v4.app.BackStackRecord$Op, sources=[Unknown source file], tool name=Optional.of(D8)}
this is my build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.play.flyaway"
minSdkVersion 21
targetSdkVersion 27
ndk {
moduleName "player_shared"
}
}
sourceSets {
main {
jni.srcDirs = []
}
}
buildTypes{}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services:12.0.1'
implementation files('libs/dagger-1.2.2.jar')
implementation files('libs/javax.inject-1.jar')
implementation files('libs/nineoldandroids-2.4.0.jar')
implementation files('libs/support-v4-19.0.1.jar')
}
build.gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
Any solution to this problem? I already try everything I know of course, but I'm new on this, I really don't know what cause the error apart from what the console says
You need to remove the following dependency:
implementation files('libs/support-v4-19.0.1.jar')
and also remove the jar from libs directory. Then use the matching support library of your compileSdkVersion. So, change the above dependency with:
implementation 'com.android.support:support-v4:27.1.1'
This is related with Google play service dependency:
SDK Version Support in 11.2
When you upgrade your app’s Play services dependencies to 11.2.0 or
later, your app’s build.gradle must also be updated to specify a
compileSdkVersion of at least 26 (Android O). This does not change the
way your app runs. You will not be required to update
targetSdkVersion.
It's about duplicated support library used :
This dependency:
implementation files('libs/nineoldandroids-2.4.0.jar')
is using old version of support library. Try excluding the support library with:
implementation files('libs/nineoldandroids-2.4.0.jar'){
exclude group: 'com.android.support'
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
}
This Problem is caused due to the versions of the support file and plays service. Update the play service dependencies as per the recommendations(Latest) and sync the project.
compile 'com.google.android.gms:play-services:12.0.1'
I have used only support:AppCompat, so having this problem
Solved this using implementation 'com.android.support:design:____'
implementation 'com.android.support:support-v4:____' along with AppCompat
In my case the problem was I already had the jar present in lib/ folder. Deleting it resolved the problem.
So check if you have jar present in any folder:
find . -name *.jar
If present in lib folder try deleting it

Android Studio - Adding SDK versions and dependencies to all module [duplicate]

This question already has an answer here:
Import app compat dependency in all libraries
(1 answer)
Closed 5 years ago.
In my currently working project contains lot of modules and dependency. So is there is any way to keep all this versions and dependency common and reuse in all modules. I know that we can define common dependency in root build.gradle file but whats about things like compileSdkVersions and exclude groups.
My dependency some times include exclude group like.
androidTestCompile ('com.android.support.test:rules:1.0.1'){
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
How can we handle this scenario?
Once we have add in root build.gradle, Is there any way to add them all in a app module with out specifying individual ones like below.
compile deps.cardview
compile deps.design
compile deps.supportv4
compile deps.animation
compile deps.pagination
compile deps.shimmerlayout
compile deps.enhanced_card
compile deps.swipeanim
compile deps.appcompact
For things like compileSdkVersion, buildTypes and compileOptions, I define sth like this in root gradle file :
ext.android_settings_for_module = {
compileSdkVersion COMPIlE_SDK_VERSION.toInteger()
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion
targetSdkVersion
versionCode
versionName
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
compileOptions compile_options
lintOptions lint_options
testOptions test_options
}
ext.lint_options = {
//butterKnife
disable 'InvalidPackage'
}
ext.compile_options = {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
And then, in your module file, you can use :
android android_settings_for_module
Quite Similar for dependencies. Define a field in root gradle file :
ext.common_libs = [
]
And then use in module level gradle file :
dependencies {
compile common_libs
}
For sharing common SDK version and Dependencies. You can define shared gradle dependencies in the library module, and if the app module has the library as a dependency, you won't need to specify everything twice. Taking this further, you could create a 'common' module that requires the shared gradle dependencies, and have both the app & library module require the common module.
have look :
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
// Load dependencies
apply from: 'dependencies.gradle'
here is dependencies.gradle: for all module and sdk version in app.
ext {
//Version
supportLibrary = '22.2.1'
//Support Libraries dependencies
supportDependencies = [
design : "com.android.support:design:${supportLibrary}",
recyclerView : "com.android.support:recyclerview-v7:${supportLibrary}",
cardView : "com.android.support:cardview-v7:${supportLibrary}",
appCompat : "com.android.support:appcompat-v7:${supportLibrary}",
supportAnnotation: "com.android.support:support-annotations:${supportLibrary}",
]
}
Happy Coding!!

Using Dagger 2.11 with kotlin in android [duplicate]

I created a new project in Android Studio 2.2 Preview 1 with Android App and Backend module with Google Messaging. This is the app file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
compile project(path: ':backend', configuration: 'android-endpoints')
}
But it's giving:
Error:Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (1.3.9) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
I am new to Android and not able to find what is this error. How do I fix it?
In your app's build.gradle add the following:
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
Enforces Gradle to only compile the version number you state for all dependencies, no matter which version number the dependencies have stated.
This is due to espresso. You can add the following to your apps build.grade to mitigate this.
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude group: 'com.google.code.findbugs'
}
METHOD 1:
I deleted the androidTestCompile on espresso-core line which was automatically included in a new project. Then my Android Studio compiles clean.
The androidTestCompile is in "build.gradle (Module:app)":
dependencies {
...
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
...
}
I don't know whether this deletion will have any problem down the road, but it surely works for my current project now.
METHOD 2: Adding an exclude on findbugs works too:
dependencies {
...
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs'
})
...
}
METHOD 3: Forcing compiling with a specific version:
(In the following I force it to compile with the higher version.)
dependencies {
...
androidTestCompile 'com.google.code.findbugs:jsr305:3.0.0'
...
}
From Gradle Plugin User Guide:
When instrumentation tests are run, both the main APK and test APK share the same classpath. Gradle build will fail if the main APK and the test APK use the same library (e.g. Guava) but in different versions. If gradle didn't catch that, your app could behave differently during tests and during normal run (including crashing in one of the cases).
To make the build succeed, just make sure both APKs use the same version. If the error is about an indirect dependency (a library you didn't mention in your build.gradle), just add a dependency for the newer version to the configuration
Add this line to your build.gradle dependencies to use newer version for both APKs:
compile('com.google.code.findbugs:jsr305:2.0.1')
For future reference, you can check your Gradle Console and it will provide a helpful link next to the error to help with any gradle build errors.
The reason why this happen is that diff dependency use same lib of diff version.
So, there are 3 steps or (1 step) to solve this problem.
1st
Add
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:2.0.1'
}
to your build.gradle file in android {...}
2nd
Open terminal in android studio
run ./gradlew -q app:dependencies command.
3rd
Click Clean Project from menu bar of android studio in Build list.
It will rebuild the project, and then
remove code in 1st step.
Maybe you need just exec 2nd step. I can't rollback when error occurs.
Have a try.
When I added module: 'jsr305' as an additional exclude statement, it all worked out fine for me.
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude module: 'jsr305'
})
The problem, as stated in your logs, is 2 dependencies trying to use different versions of 3rd dependency.
Add one of the following to the app-gradle file:
androidTestCompile 'com.google.code.findbugs:jsr305:2.0.1'
androidTestCompile 'com.google.code.findbugs:jsr305:1.3.9'
The accepted answer is one way of fixing the issue, because it will just apply some strategy for the problematic dependency (com.google.code.findbugs:jsr305) and it will resolve the problem around the project, using some version of this dependency. Basically it will align the versions of this library inside the whole project.
There is an answer from #Santhosh (and couple of other people) who suggests to exclude the same dependency for espresso, which should work by the same way, but if the project has some other dependencies who depend on the same library (com.google.code.findbugs:jsr305), again we will have the same issue. So in order to use this approach you will need to exclude the same group from all project dependencies, who depend on com.google.code.findbugs:jsr305. I personally found that Espresso Contrib and Espresso Intents also use com.google.code.findbugs:jsr305.
I hope this thoughts will help somebody to realise what exactly is happening here and how things work (not just copy paste some code) :).
Add this this to dependencies to force using latest version of findbugs library:
compile 'com.google.code.findbugs:jsr305:2.0.1'
delete espresso dependencies in gradle file works for me.
delete those lines in app gradle file:
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
i was trying to use airbnb deeplink dispatch and got this error. i had to also exlude the findbugs group from the annotationProcessor.
//airBnb
compile ('com.airbnb:deeplinkdispatch:3.1.1'){
exclude group:'com.google.code.findbugs'
}
annotationProcessor ('com.airbnb:deeplinkdispatch-processor:3.1.1'){
exclude group:'com.google.code.findbugs'
}
Those who are getting same error in Android 3.0.1,can resolve it by simply update the versions of compileSdkVersion and targetSdkVersion to 27 and also Implement com.android.support:appcompat-v7:27.1.1' in dependencies.
In project ':app' you can add the following to your app/build.gradle file :
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
For react-native-firebase, adding this to app/build.gradle dependencies section made it work for me:
implementation('com.squareup.okhttp3:okhttp:3.12.1') { force = true }
implementation('com.squareup.okio:okio:1.15.0') { force = true }
implementation('com.google.code.findbugs:jsr305:3.0.2') { force = true}
REACT NATIVE
If you looking for react native solution, then write this snippet in your affected node_modules gradle build file, e.g. firebase in my case.
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.0'
}
}

Multiple dex files define Lcom/google/firebase/FirebaseException

I encountered a problem with the Firebase integration. First of all, I have added rules to the root-level build.gradle file:
buildscript {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And the module Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 14
targetSdkVersion 24
versionCode 2
versionName "0.9"
}
buildTypes {
///
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-crash:9.0.2'
}
apply plugin: 'com.google.gms.google-services'
During the build of the project, I get the error:
Error:Error converting bytecode to dex: Cause:
com.android.dex.DexException: Multiple dex files define
Lcom/google/firebase/FirebaseException;
Error reason is clear, but I didn't compile any library twice. Should I exclude FirebaseException class from the build process manually? If so, how? Perhaps this is a bug within the Firebase dependencies?
Thanks.
I had this problem with react-native-google-signin module. As the instructions how to modify build.gradle are often not up to date, incomplete or just defined in multiple unrelated projects the project compiled only after copying the settings from the react-native-google-signin example project. It turns out the order of statements is important as well as exclude group command. The final result looked like this (in app/build.gradle):
dependencies {
...
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile(project(":react-native-google-signin")) {
exclude group: "com.google.android.gms"
}
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
The top build.gradle included an additional gms classpath as usual:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
After these changes build finished without any Multiple dex errors.
FireBase is a huge library, so you need to enable multidex support in your application.
dependencies {
compile ('com.google.firebase:firebase-core:9.0.2') {
exclude module: 'play-services-base'
exclude module: 'support-v4'
exclude module: 'support-annotations'
}
compile 'com.android.support:multidex:1.0.1'
}
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
Looks like you have reached methods count limit. Try to remove firebase dependencies and check methods count for your app (for example, with this gradle plugin (if you don't remove these dependencies you won't be able to build your project at all, thus, to use the methods count plugin).
Firebase is a HUGE library - 17k+ methods. It depends on tons of stuff. One thing you can do is to check dependencies list by clicking this button on "methodscount.com":
If you already have some of these in your project you can try to exclude them:
compile ('com.google.firebase:firebase-core:9.0.2') {
exclude module: 'play-services-base'
exclude module: 'support-v4'
exclude module: 'support-annotations'
}
If this doesn't help then you might want to configure multidex for you project.
I am using react-native-maps and react-native-google-signin.
And, I got Multiple dex files define Lcom/google/firebase/FirebaseException
Bellow my solution.
Open build.gradle (react-native-maps)
dependencies {
provided "com.facebook.react:react-native:+"
compile "com.google.android.gms:play-services-base:10.2.4"
compile "com.google.android.gms:play-services-maps:10.2.4"
}
The version is 10.2.4
Continue open build.gradle (react-native-google-signin)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:appcompat-v7:23.0.1"
compile 'com.google.android.gms:play-services-auth:9.2.1' <- change here
compile "com.facebook.react:react-native:+"
}
It uses version 9.2.1, and this is reason.
Change it to version 10.2.4 will be
compile 'com.google.android.gms:play-services-auth:10.2.4'
Next, open build.gradle (app) and add a new one
compile 'com.google.android.gms:play-services-auth:10.2.4'
Now you have.
compile 'com.google.android.gms:play-services-auth:10.2.4'
compile(project(":react-native-google-signin")){
exclude group: "com.google.android.gms"
}
Run command cd android & gradlew clean & cd .. util no error then run react-native run-android.
Hope can help.
In case it helps anyone, I was hitting a similar problem, it was caused by the Gradle plugin for Google services bringing in a dependency which conflicted with Firebase.
In my top level build.gradle I had, in buildscript:
classpath 'com.google.gms:google-services:3.0.0'
Which was bringing in (automatically) dependencies which were conflicting with, in my app's build.gradle:
compile 'com.firebaseui:firebase-ui-auth:2.2.0'
Little bit confusing as I only had one compile dependency and was scratching my head what could be conflicing.
I removed the google-services gradle plugin and it solved the issue. I suppose I could also just find the right version :)
I encountered this error when I was using firebase-ui:2.0.0. I managed to solve it by downgrading to 'com.firebaseui:firebase-ui:1.2.0' and added the following line in Project level build.gradle:
allprojects {
repositories {
jcenter()
// Add the following
maven {
url 'https://maven.fabric.io/public'
}
}
}
Thanks to this post, just check and upgrade your google dependencies versions to the last release.
I could fix my problem. The problem was that BaseGameUtils was still
using/referencing an older version of play-services. Added the correct
version, and it works now. Guess I will omit BaseGameUtils for my next
project.
This is because some of your libraries use different versions of other library.
Check out your last added library and exclude.
For my project that was 'react-native-firestack'.
compile(project(':react-native-firestack')){
exclude group: "com.google.android.gms" // very important
}
Please add this code inside android in build.gradle
dexOptions {
preDexLibraries = false
}

configuration issue. "Configuration with name 'default' not found"

I am relatively new to Android development and VERY new to Android Studio (much more experienced with Eclipse + android plugin). I am trying to edit a github project, but I can't seem to get it to even compile! I have been reading up, and my error seems to have to do with the build.gradle/locations of libraries themselves.
My error is:
Error:Configuration with name 'default' not found.
It also says "Gradle project sync failed, but I think its related to the above error…whatever that means.
My outer build.gradle is:
// Top-level build file where you can add configuration options common to all sub- projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
And my inner build.gradle file is:
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 20
buildToolsVersion '20.0.0'
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
defaultConfig {
applicationId "com.wisely.loyalty"
minSdkVersion 14
targetSdkVersion 18
versionCode 17
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':facebook')
compile project(':cwac')
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'
compile('org.apache.httpcomponents:httpmime:4.3.5') {
exclude module: "httpclient"
}
compile 'com.android.support:support-v13:20.0.0'
compile 'com.google.android.gms:play-services:5.0.+'
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2'
compile 'com.makeramen:roundedimageview:1.3.0'
compile 'com.crashlytics.android:crashlytics:1.+'
}
EDIT:
General file hierarchy
root
.idea
app
libs
cwac
fb
utils
src
… all source files
gradle
build.gradle
settings.gradle
External Libraries
Android API 20 Platform
JDK
EDIT: Settings.gradle:
include ':app', ':facebook', ':cwac', ':utils'
project(':facebook').projectDir = new File('app/libs/facebook')
project(':cwac').projectDir = new File('app/libs/cwac')
project(':utils').projectDir = new File('app/libs/utils')
Progress Update:
I've tried moving the library files around in the directory to no avail. I also tried using my eclipse environment which just seemed to have even more issues. I really need to get this project configured properly!
UPDATE #2:
I have a strong feeling that this has to do with the gradle version since the file configuration seems fine, and its likely my computer that is lacking something. I am new to using gradle. Is there a way to update it? Or is it simply updated through the support libraries in the sdk manager?
Add your library folder in your root location of your project and copy all the library files there. For ex YourProject/library then sync it

Categories

Resources