I include some dependencies (v23.2.0), but in my project, more external libraries that I didn`t include were there(v24.2.1), so Could you help me to figure out where I made the mistakes?
Here is my pic and code .
app.gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':common')
apt 'com.zhy:mpermission-compiler:1.0.0'
compile project(':umeng')
}
common.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.zhy:okhttputils:2.6.2'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup:otto:1.3.7'
compile 'com.zhy:autolayout:1.4.5'
compile 'com.yanzhenjie:permission:1.0.5'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'io.reactivex:rxjava:1.0.13'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.zhy:mpermission-api:1.0.0'
compile 'com.github.satyan:sugar:1.5'
}
umeng.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.0'
}
These Libraries are added with the compile 'com.android.support:design:23.2.0' library
Related
Hi i added one signal libraries in to my project and suddenly when i run the project a lots of error shows up in my code which in top is
Error:(66, 8) error: cannot access ActivityCompatApi23
class file for android.support.v4.app.ActivityCompatApi23 not found
here is my dependecies
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:26.0.0-alpha1'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.github.lzyzsd:circleprogress:1.1.0#aar'
compile 'com.github.clans:fab:1.6.2'
compile 'se.emilsjolander:StickyScrollViewItems:1.1.0'
compile 'se.emilsjolander:stickylistheaders:2.1.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.hashids:hashids:1.0.1'
compile 'com.google.android.gms:play-services-analytics:10.2.1'
compile 'com.google.android.gms:play-services-drive:10.2.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.onesignal:OneSignal:3.+#aar'
compile 'com.google.android.gms:play-services-gcm:10.2.1'
compile "com.google.android.gms:play-services-location:10.2.1"
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.android.gms:play-services-analytics:10.2.1'
compile 'com.adjust.sdk:adjust-android:4.12.0'
compile 'com.android.installreferrer:installreferrer:1.0'
You are using different versions for support libraries
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:26.0.0-alpha1' <- here you are compiling 26.0.0-alpha1
// ...
compile 'com.android.support:appcompat-v7:26.+'
// ...
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:26.+' <- this one can be different from 26.0.0-alpha1 since it compiles versions greater than 26, i.e. version 27.1.1
compile 'com.android.support:design:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support:cardview-v7:26.+'
// ...
So when gradle tries to build your project, it finds two different support library versions.
I guess you can fix your problem with upgrading all your support libraries to version 27.1.1. Like this
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:27.1.1'
// ...
compile 'com.android.support:appcompat-v27.1.1'
// ..
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
// ...
Also, as parekhkruti26 said in comments, never use 'X.+' for versions since it can cause problems like this and its not recommended. I guess android studio itself shows a warning when adding dependencies using 'X.+'.
I have a project project A that has these dependencies:
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:palette-v7:24.0.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.android.support:customtabs:24.0.0'
compile ('com.hannesdorfmann.smoothprogressbar:library:1.0.0'){
transitive = true
}
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'jp.wasabeef:blurry:2.0.2'
compile 'com.karumi:dexter:2.3.1'
compile 'io.card:android-sdk:5.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.cocosw:bottomsheet:1.+#aar'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'me.leolin:ShortcutBadger:1.1.3'
compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:1.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.13.2'
compile 'xyz.danoz:recyclerviewfastscroller:0.1.3'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.android.support:multidex:1.0.1'
// compile 'joda-time:joda-time:2.9.3'
compile 'com.github.clans:fab:1.6.3'
compile files('libs/jsevaluator.jar')
compile files('libs/libphonenumber-7.0.2.jar')
compile project(':zoneOrchestra')
compile project(':scrambledkeyboard')
compile project(':datelibrary')
compile project(':phoneNumberValidator')
compile project(':library')
compile project(':inputtypepicker')
compile project(':pagerIndicator')
compile project(':persistentSearch')
compile('com.github.KingsMentor:IntentManip:v1.0.2') {
exclude group: 'com.android.support'
}
compile('com.twitter.sdk.android:tweet-composer:0.8.0#aar')
{
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
}
the project is bundle to project.aar , which should serve as a dependency to other projects.
The problem is, when project.aar is added to another project, it is unable to build. It requires it's dependencies which for some reasons are not bundled with it.
How do I make sure these dependencies are bundled along with the .aar file?
Im trying to import an sdk called ringcaptcha and unfortunately I have followed their docs without much success. I have the following statement in my build.gradle file:
repositories {
maven { url 'http://ringcaptcha.github.io/ringcaptcha-android'}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:percent:23.3.0'
compile 'com.google.android.gms:play-services-maps:6.5.87'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.thrivecom:ringcaptcha:1.0.8#aar' // SMS service
}
And I get Failed to resolve com.thrivecom.ringcaptcha:1.0.8 ?
Below are my app dependencies
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
// compile 'com.android.support:support-v13:21.0.3'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.jakewharton:butterknife:5.1.2'
compile files('src/libs/android_sync_service_library.jar')
compile files('src/libs/gson-2.2.4.jar')
compile 'com.google.android.gms:play-services:7.3.0'
compile('com.crashlytics.sdk.android:crashlytics:2.2.2#aar') {
transitive = true;
}
compile project('my module name')
}
and my module dependencies
dependencies {
compile project(':ingosdk')
compile 'com.google.code.gson:gson:2.2.4'
compile files('libs/A2iA.Mobility.jar')
compile files('libs/acra-4.5.0.jar')
compile files('libs/bugsense-3.5.jar')
compile files('libs/deviceprint-lib-1.0.0.jar')
compile files('libs/espresso-1.1-bundled.jar')
compile files('libs/FlurryAnalytics-5.3.0.jar')
compile files('libs/httpmime-4.1.2.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/volley.jar')
}
I am using ActionBarSherlock in my module and appcompat v7 library in my application. In my case both are required. How can I solve the "attribute already defined" issue?
The versions I use in my app:
buildToolsVersion 22.0.1
targetSdkVersion 21
You can't use appcompat-v7 and actionbarsherlock at the same time, just use one of them.
I've just updated to Android Studio 1.0 RC 4 and it gives me some strange errors, but I can't figure out why.
The errors are:
Error:Class android.support.v4.net.ConnectivityManagerCompatGingerbread has already been added to output. Please remove duplicate copies.
Error:Class android.support.v4.net.TrafficStatsCompat has already been added to output. Please remove duplicate copies.
And my build.gradle (the compile section) is:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.android.support:support-v4:19.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.3.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.3.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
//compile 'com.github.mrengineer13:snackbar:0.4.0'
//compile 'com.android.support:support-v4:21.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.android.support:appcompat-v7:21.0.+'
//compile 'com.android.support:cardview-v7:21.0.+'
//compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.pnikosis:materialish-progress:1.0'
}
I've read in some others questions that it depends on two dependencies that share the same classes from v4, but I can't figure out which ones.
I'll hope someone can help.
First, try to update your jacksons versions your are using from 2.3.2 to 2.4.0.
Here is your new code:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.android.support:support-v4:19.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.4.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.0'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
//compile 'com.github.mrengineer13:snackbar:0.4.0'
//compile 'com.android.support:support-v4:21.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.android.support:appcompat-v7:21.0.+'
//compile 'com.android.support:cardview-v7:21.0.+'
//compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.pnikosis:materialish-progress:1.0'
}
It compile for me.