I want to include recyclerview in my application , I've updated the whole sdk . The android support repository is version 17 ,android support library is version 23 . I've recyclerview folder in sdk\extras\android\support\v7 directory .
For adding the library , I've put these in dependencies :
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0.+'
}
when I rebuild the project ,it shows me this error :
Error:(24, 13) Failed to resolve: com.android.support:recyclerview-v7:21.0.0.+
Install Repository and sync project<br>Show in File<br>Show in Project Structure dialog
What version of recyclerview should I use in dependencies ? How to know it?
EDIT
I solve the last problem with the help of a friend , this is the new gradle :
dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
}
Now I get this error :
F:\AndroidStudioProjects\recycleView\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0\res\values-v17\values-v17.xml
Error:(6, 21) No resource found that matches the given name: attr 'android:textAlignment'.
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'...............
How to solve this one ?
You have this issue becuase
compile 'com.android.support:recyclerview-v7:21.0.0.+'
is wrong.
You can use
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.+'
compile 'com.android.support:recyclerview-v7:+'
But you can't use
compile 'com.android.support:recyclerview-v7:21.0.0.+'
Of course I suggest you using the last support library, currently the 23.1.0
compile 'com.android.support:recyclerview-v7:23.1.0'
Pay attention. This requires to compile with API 23.
Also I suggest you avoiding the +. It is not a good choice because in this way you can't replicate your build in the future.
Better to use the latest dependency supported by android to get the latest feature and fixes provided by Android. To add a dependency follow the steps mentioned below :
Right click on your app module in project explorer.
Select "Module Settings" from the option menu.
Click on the "Dependency" tab.
Click the "+" or "-" button to add or remove dependency.
Click on + and search for dependency by giving it's name and click on the appropriate dependency.
This way you will get the latest dependecy supported by android.
use 23.0.0
compile 'com.android.support:recyclerview-v7:23.0.0'
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 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.
Where can i download the jar file for com.android.support packages such as com.android.support:appcompat-v7 or com.android.support:design ?
I looked at mavenCentral and jCenter but there was nothing there.
EDIT:
probably get wasn't the right word to use. i want to download them and use them offline.
YOu can get it from gradle. If you are using Android Studio just go to build.gradle and add the following under depedencies
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:appcompat-v7:23.2.1'
I have the following problem:
I installed the Google Play Services library v27.0.0 to my SDK in Android Studio.
After that I added the compile dependencie to build.gradle (app folder):
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.google.android.gms:play-services:27.0.0'
}
But when I try to sync the project with Gradle, i get this error message:
Error:(25, 13) Failed to resolve: com.google.android.gms:play-services:27.0.0
I don't know what to do...
I don't think version 27.0.0 exists the most recent version is 8.1.0
There is one trick you can use with any dependency.
You know the name of dependency, lets consider com.google.android.gms:play-services:
Firstly, you need to use this expression
compile 'com.google.android.gms:play-services:+'
Note the plus sign. Than you click Sync Now to sync gradle. After that you will see that IDE suggests you not to use + sign.
But now you can use combination Alt+Enter and select Replace with specific version.
Now + sign will be replaced with the latest available version of this library.
Profit.
I have been trying to add android-support-v13 in Android Studio 1.0.2
I have followed the steps here but I still get a build fail. Has anyone successfully managed to add android-support-v13.jar into Android Studio 1.0.2?
Below is my code in my gradle file.
dependencies {
compile 'com.android.support:appcompat-v7:21.0.3'
compile fileTree(dir: 'libs',include: '*.jar')
Edit: I have installed extra support library from SDK manager and I have placed the .jar in my libs folder.
according to docs at this time:
The Gradle build script dependency identifier for this library is as
follows:
com.android.support:support-v13:18.0.0
lets hope that the docs are updated.
for the latest you should use:
compile 'com.android.support:support-v13:21.0.+'
same problem android studio 1.0.2 i solve that below
compile 'com.android.support:appcompat-v7:21.0.1'
compile 'com.android.support:appcompat-v7:+'