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.+'.
Related
I'm trying to make my app use PreferenceFragmentCompat
My dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:preference-v7:25.4.0'
compile 'com.android.support:preference-v14:25.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.google.firebase:firebase-ads:11.8.0'
compile 'io.github.kobakei:ratethisapp:1.2.0'
compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3'
compile 'com.github.chrisbanes:PhotoView:2.1.3'
testCompile 'junit:junit:4.12'
}
What I newly added in:
compile 'com.android.support:preference-v7:25.4.0'
compile 'com.android.support:preference-v14:25.4.0'
The error is about the first dependency:
compile 'com.android.support:appcompat-v7:25.3.1'
It says:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.4.0, 25.3.1. Examples include com.android.support:animated-vector-drawable:25.4.0 and com.android.support:cardview-v7:25.3.1 less... (Ctrl+F1)
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)
It's telling you exactly, all
com.android.support:**
Should use the same version
Change it to:
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support:preference-v7:25.4.0'
compile 'com.android.support:preference-v14:25.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support:support-vector-drawable:25.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.google.firebase:firebase-ads:11.8.0'
compile 'io.github.kobakei:ratethisapp:1.2.0'
compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3'
compile 'com.github.chrisbanes:PhotoView:2.1.3'
Always use/update same support library version so replace your code with:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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:25.4.0'){force true}
compile ('com.android.support:design:25.4.0'){force true}
compile ('com.android.support:support-v4:25.4.0'){force true}
compile ('com.android.support:preference-v7:25.4.0'){force true}
compile ('com.android.support:preference-v14:25.4.0'){force true}
compile ('com.android.support:cardview-v7:25.4.0'){force true}
compile ('com.android.support:support-vector-drawable:25.4.0'){force true}
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.google.firebase:firebase-ads:11.8.0'
compile 'io.github.kobakei:ratethisapp:1.2.0'
compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3'
compile 'com.github.chrisbanes:PhotoView:2.1.3'
testCompile 'junit:junit:4.12'
}
To get duplicate dependency report check this SO
Error:(66, 30) error: package PhoneAuthProvider does not exist
This is my app build.gradle
P.S multidex enabled is true
Why this error happens?
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
// this line must be included to integrate with Firebase
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.google.firebase:firebase-storage:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.github.barteksc:android-pdf-viewer:2.5.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.kenglxn.QRGen:android:2.2.0'
compile 'me.dm7.barcodescanner:zxing:1.9'
compile 'com.google.zxing:core:3.2.1'
compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.1'
compile 'com.afollestad.material-dialogs:core:0.9.4.5'
compile 'com.github.clans:fab:1.6.2'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.github.chrisbanes:PhotoView:2.0.0'
compile 'me.grantland:autofittextview:0.2.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.theneura:android-sdk:+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Use :
compile 'com.google.android.gms:play-services-auth:11.0.2'
Instead of :
compile 'com.google.android.gms:play-services-auth:10.2.0'
the phone authentication was released with Firebase Android SDK v11 you need to update your auth module to 11.0.2 instead of 10.2.0
I am getting this error while I try to run my Android Application,
I have used Reside Menu as merge into my Application (not by Gradle dependency) and then I am trying to integrate a payment gateway but while using a payment gateway I have to import ".aar" package.
After successfully importing, when I try to run my application at that time I got this error of library "nineoldandroids". I think this error triggered because one of the my gradle plugin is also using the same library.
Please take a look of my gradle :-
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
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:24.2.1'
compile project(':cal_library')
compile project(':mobicomkitui')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'com.droidninja:filepicker:2.0.3'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.leavjenn.smoothdaterangepicker:library:0.2.0'
compile 'com.github.skydoves:elasticviews:1.0.6'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.github.johnpersano:supertoasts:1.3.4#aar'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.yalantis:ucrop:2.2.0'
compile 'com.onesignal:OneSignal:3.+#aar'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.j256.ormlite:ormlite-android:5.0'
compile 'com.j256.ormlite:ormlite-core:5.0'
compile 'com.github.kayvannj:PermissionUtils:1.0.2#aar'
}
So what could be the problem ?
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
I'm using multi library which they are installed by Gradle on my appliaction, after opening application each time i get simple delay on opening application such as 10 second :| if i download libraries instead of using and installing by Gradle, that cause of speed up my application or not?
My Gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:0.4.0'
compile 'com.jakewharton.rxbinding:rxbinding-design:0.4.0'
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'frankiesardo:icepick:3.2.0'
provided 'frankiesardo:icepick-processor:3.2.0'
compile('io.socket:socket.io-client:0.7.0') {
exclude group: "org.json", module: "json"
}
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.github.devlight.navigationtabbar:library:+'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.github.chyrta:AndroidOnboarder:+'
compile 'com.github.lamydev:android-notification:3.0'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.bugsnag:bugsnag-android:+'
compile 'com.github.liuguangqiang.swipeback:library:1.0.2#aar'
compile 'com.wunderlist:sliding-layer:1.2.5'
compile 'com.facebook.rebound:rebound:0.3.8'
compile 'com.tumblr:backboard:0.1.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.jaredrummler:android-device-names:1.0.9'
compile 'org.sufficientlysecure:html-textview:1.6'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.2'
compile 'com.kogitune:pre-lollipop-activity-transition:1.3.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.alexvasilkov:foldable-layout:1.2.0'
compile 'com.mikhaellopez:circularfillableloaders:1.2.0'
compile 'cat.ereza:customactivityoncrash:1.5.0'
compile 'jp.wasabeef:glide-transformations:2.0.1'
compile 'com.github.hotchemi:permissionsdispatcher:2.1.3'
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3'
compile 'com.github.goka.flickableview:flickableview:1.0.0'
compile 'com.github.Kennyc1012:BottomSheet:2.1.2'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile('com.github.ozodrukh:CircularReveal:2.0.1#aar') {
transitive = true;
}
compile project(':lib-searchview')
}
No because gradle saves them locally, you can go to your gradle.properties and set these values and enable the gradle to use more of your machine compute power.
-Xms4096m
-Xmx4096m
-XX:MaxPermSize=2048m
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+HeapDumpOnOutOfMemoryError
-Dfile.encoding=utf-8