Wants to use RecyclerView like described in this tutorial. But have problem already adding the import statement: Can not resolve symbol 'RecyclerView'.
Added compile statement to gradle script,
compile 'com.android.support:recyclerview-v7:23.1.1'
but Android studio says that a more recent version is available. Can this cause that import statement is not accepted?
23.1.1 is not the latest version of android support library
To get the current latest version you should use this if you're using compileSdkVersion 23:
compile 'com.android.support:recyclerview-v7:23.4.0'
or if you're using compileSdkVersion 24 then use this:
compile 'com.android.support:recyclerview-v7:24.0.0'
and to get the latest version available automatically, you can use this :
compile 'com.android.support:recyclerview-v7:+'
Related
Today, I update my Android studio to 2.3, and I update gradle to 3.4.1. But when I build my project, an error occurred:
This is the error
So I add " buildToolsVersion '25.0.0' "
My project can build successful, but another error occurred. I can't solve it. I hope to get some help. Thank you!
This is the error
When I add compile 'com.prolificinteractive:material-calendarview:1.4.2', this error will occur.
This is my androidDependencies
This is probably an issue with Android Studio 2.3. There's a new inspection that checks if all dependencies of com.android.support use the same version number. However, multidex doesn't have a matching version number. You can disable the inspection via the red light bulb icon next to it as a work-around for now
it's an unnecessary warning for the support:multidex, add this:
//noinspection AndroidLintGradleCompatible
compile 'com.android.support:multidex:1.0.1'
I'm also using updated Studio. You should use each library with the same version in order to avoid the Manifest Merger issue. Like this.
// To Support Design, CardView and RecyclerView Library
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:palette-v7:25.2.0'
// To Support MultiDex
compile 'com.android.support:multidex:1.0.1'
Here you will notice that each library have the same version.
Change version of com.android.support:recyclerview-v7 and com.android.support:support-core-utils to 25.2.0 (last version of support library: https://developer.android.com/topic/libraries/support-library/revisions.html)
I am facing this error after upgrading my google servces plugin. Apparently there is no version conflict as you can see its 9.2.0, the compiler is giving a completely different error of google services-plugin.
I have searched for it on many places and I have found people are getting this error because they haven't written this at the end:
apply plugin: 'com.google.gms.google-services'
but I have written it and still getting this error.
Here is what the error looks like:
The problem is with com.google.android.gms:play-services-auth:10.0.1 which is newer version as compared to other dependencies with version 9.2.0. You can simply use latest version of each of them and resolve conflicts.
So either go for 9.2.0
compile 'com.google.android.gms:play-services-auth:9.2.0'
compile 'com.google.firebase:firebase-auth:9.2.0'
or for 10.0.1
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
And obviously I would suggest to go for latest version always.
Use the same version for every thing.
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.firebase:firebase-aurh:10.0.1'
About Android support library, since 25.0.1 has some bugs, so I want to use 7.24.1,
here's some of my gradle codes
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
But I find the project still refers the latest version; the version number "v7:24.2.1" does not work.
I want use 7:24.2.1, but when I click any Android support class, such as RecyclerView, it opens source code from sdk\extras\android\m2repository\com\android\support\recyclerview-v7\25.0.0\recyclerview-v7-25.0.0-sources.jar
Clean Project will do the trick. Furthermore consider to change compileSdkVersionto24 and also install Android SDK Build-tools in Android SDK Manager.
As the latest version of the support library according to the support library changelog is v7:25.0.1 and not v7:24.2.1 modify your build.gradle to have v7:25.0.1:
compile "com.android.support:appcompat-v7:25.0.1"
However, if you really need v7:24.2.1 then simply put:
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
You dont have to put the rest. They are already included as stated by cricket_007.
It turns out one of the depencencies include the android suppoert library25.0.0,
I solve it by downgrading the depencency library
I am facing a issue after run existing android studio project. Please check error below and let me know how to resolve that.
Error:(54) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Thanks in advance
Try to use accroding gradle plugin. I've got the problem with plugin 2.3-beta1 and Studio 2.2.3, when changed to plugin 2.2.3 - everything worked like a charm
Please change compileSdkVersion and buildToolsVersion in your gradle file according to your android studio existing running project.
Our compile SDK version must match the support library's major
version.
If you are using version 23 of the support library, you need to compile against version 23 of the Android SDK.
Alternatively you can continue compiling against version 22 of the Android SDK by switching to the latest support library v22.
You can either change it manually in your build.gradle, or you can use
the GUI by opening up the project properties and going to the
"dependencies" tab.
Or Press Ctrl + Shift + Alt + S to get to the project structure page. Go to the properties tab and change version to 23.0.0 or whatever latest in the build tool area and rebuild your project.
If that doesn't work, go to gradle:app and then
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
Edit version as shown above and sync gradle.
Ran into same issue as OP, March 2017 Android Studio 2.3.
My build was working fine for months, and this issue came up right after adding a new line to gradle build file. Ultimately making some changes in Gradle and re-sync'ing fixed the issue, but my Gradle ended up being exactly the same as when the issue first came up, strangely.
My original Gradle build dependencies:
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:gridlayout-v7:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.google.android.gms:play-services-location:10.0.0'
compile 'com.google.android.gms:play-services-maps:10.0.0'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.4'
Then, I simply added a new line:
compile 'org.scribe:scribe:1.3.5'
This is when the issue appeared, same as OP.
I saw red errors in my styles.xml and wondered "wtf?".
Cleaning and re-building had no affect.
Going back to the Gradle build file, I commented-out that new line. ISSUE RESOLVED! So obviously there was something going on.
For fun, I put that line, uncommented, at the top of this compile list. NO ISSUE!
For fun yet again, I put that line back again to the bottom of the list (like how originally added it). NO ISSUE.... weird!
How Gradle sync'ing responds doesn't seem to be 100% consistent. I did no other changes to my project. All I can say is try toggling and re-ordering things in the compile list.
There are lots of same question on this problem and in solution they said update gradle version but I'm using latest version then also I'm facing this issue
kindly help me with this.
Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "bd8994644a28e456358162533e01319cc08f4ef8"
Fix plugin version and sync projectOpen File
try with this versions
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
Hi change to and test :
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
I just updated my Android support library, Local Maven repository for support Libraries and Tools
and added this in build.gradle and it worked.
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'