I use recyclerveiw in my android app,
I use firebase-ui:2.1.0 in my gradle,but I find that if my android is 6.0 or over,
my app will bug.
So I update my dependencies to firebase-ui:3.1.0.
(refer to this link )
But It happened this error message:
How could I solve this problam? plz
I had the same problem.
Just make sure your
compile 'com.android.support:appcompat-v7:26.1.0'
version is the same as
targetSdkVersion 26
Mine was different and changing just this solved the problem.
Related
Hey people,
I'm having this problem about a few hours. I already tried with Invalider cache/Restart but didn't work also I downloaded the last versions of the SDK Tools. Anyone knows how to solve it?
This is my gradle
Also, I'm having this issue too
Thanks in advance.
In your app level build.gradle file, specify:
dependencies {
compile 'com.android.support:recyclerview-v7:26.0.3'
compile 'com.android.support:design:26.0.3'
...
}
The render in Layout is 26 while in the gradle the targetSdkVersion is 25
Please add constraint-layout dependency also.
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta3'
and try adding AppCompact support in dependency.
implementation 'com.android.support:appcompat-v7:27.0.0'
** Please change version names according to your build.
enter image description here
I've installed it as it is directed in the pic, but it never seems to be resolved.
I'd be on cloud nine, if somebody could help me with this.
These are the correct version that you can add in your build.gradle according to the API needs.
API 22:
compile 'com.android.support:appcompat-v7:22.0.0'
API 23:
compile 'com.android.support:appcompat-v7:23.2.0'
According to your problem in your gradle file you must put below line,
compile 'com.android.support:appcompat-v7:23.2.0'
Click on blue link as and update your sdk...when you will update it, it again gives you error (to update gradle version) so again click on error link then finally Android Studio will work perfectly.
I am currently having this error. I am using API 21 and I know some folks here suggested to upgrade it to API 22 base on previous questions but the tutorial(Slidenerd of Youtube) I am following is using API 21 and did not encountered any errors like this. Weird thing also because my RecyclerView in emulator is just working fine as expected in his tutorial and I don't why this error keeps popping up. Thanks !
It is not an error. Because the constructor is getting called while viewing the layout. Normally there are some operations which are going to be executed. To avoid this there is View.isInEditMode().
Normally you would use it like this
public Constructor(){
if(View.isInEditMode())
return;
}
If I understand your question correctly you are talking about the message the preview window of your layout is giving you?
You are probably using a version of recycler view that is newer than your compile version.
In you build.gradle file where you have added recyclerview to your dependencies you can try downgrading the version you are using
Change compile 'com.android.support:recyclerview-v7:22.2.1'
to compile 'com.android.support:recyclerview-v7:21.0.3' (or change to a 21.x.x version that suits your needs
I have installed android studio 1.4 on MAC 10.10.3 successfully. Now when I try to for demo app. development I see two errors in the main IDE, both of them are marked with arrow in the below figure
I clicked on the links (near the bottom arrow), it did some installations, but again errors were there. Now when I click on the links again it shows
Apart from this I followed other answers on stackoverflow, but with no success. Can anyone guess what can be the possible reason for both of these problems
Try this:
Change dependencies on your build.gradle your Support library.
compile 'com.android.support:appcompat-v7:22.2.0'
Try this:
compile 'com.android.support:appcompat-v7:23.1.1'
You should use the latest AppCompat library.
I also had the same problem, and after looking myself, I managed to resolve the error without accumulating any more errors by entering:
compile 'com.android.support:appcompat-v7:20.+'
My thinking is that it'll now just check for versions 7:20 and above.
Hope that helps.
After adding the appCompat v7 library I get the error that R cannot be resolved, which is apparently due to the fact that R now exists twice. I found an answer to that problem here : Build errors after adding fullscreen activity in Android Studio
However, I dont have or cant find the file attrs.xml in \src\main\res\values\attrs.xml. Is there any other solution to that problem or can someone give me a detailed description of how to do that in Android Studio?
Thank you very much!!!
Put this in your /app/build.gradle file :
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:18.0.0'
}
and make sure the version code (here 18.0.0) is not higher than the buildToolsVersion in the same file :
android {
compileSdkVersion 16
buildToolsVersion "18.0.0"
}
then rebuild your project. Hope that helps!
Oh and make sure you have the right buildTools installed via SDK Manager! Actual version is 21.0.2 I think.
I'm may be noob, but after several search i was able to add appcompat.v7 in android studio.
Initially i was comfortable with Eclipse after Dex Error 65535, my whole hard work was doomed i thought.
As Honey suggested you have to add both support.v4 or v13 and appcompat.v7 in build.gradle.
That's it. This simple solution not even covered in google docs ;). A simple reminder appcompat depends on v4 or v13.