I don't really understand why my appcompat version is not accepted
Please help
click to see image
This is a warning, your app will still run.
One or more of your transitive dependencies is requesting different version of of the Android Support Library that you are not requesting directly yourself, resulting in this conflict. You will need to run a Gradle dependency report and find out what is causing the problem, then manually request those artifacts yourself with your desired version (presently, 27.0.1).
I think in your case facebook is using old version, you should try updating facebook dependency version to latest.
You can see this answer as well.
You have probabelly some libraries that use older versions of some others support libraries (not especially AppCompat), so you have to override them manually in the gradle to get rid of this warning.
You have to repeat this until the warning disapear :
When you see the hint, copy and past the library and update the version number : for example if in the hint you have
"blablabla... example include blablabla...
com.android.support:support-core-ui:26.0.1"
Add this to the dependencies section of the build.gradle script :
implementation 'com.android.support:support-core-ui:27.1.1'
In my project I have many libraries defined in dependencies section in gradle. Problem is once in a while (once/twice a day)Android Studio gives me errors like this when opening the project or trying to get a release output:
Error:Unable to resolve dependency for ':TMessagesProj#armv7Debug/compileClasspath': Could not resolve com.google.android.gms:play-services-gcm:11.2.+.
My guess is it is because build tools is trying to check if there is an update for each library and when it doesn't find an Internet connection, it shows this error. If so, how can I change the setting in a way it doesn't have to check for updates? In other words in my project I don't need to update my libraries.
I know there is an offline mode that will probably do the trick! But I don't want to use this feature because it will probably disable some other useful features too. I just want to prevent it from automatically checking for library updates(If that's the problem shown above).
I included some part of my dependencies in gradle here:
dependencies {
compile 'com.google.android.gms:play-services-gcm:11.2.+'
compile 'com.google.android.gms:play-services-maps:11.2.+'
compile 'com.google.android.gms:play-services-vision:11.2.+'
compile 'com.google.android.gms:play-services-wallet:11.2.+'
}
Dependencies with a plus like 11.2.+' will always lead to repeated builds.
You have to specify the full version like:
com.google.android.gms:play-services-gcm:11.2.0
If you do not specify gradle will always be building because its looking for the latest version online of 11.2.+ may be 11.2.4, 11.2.6 etc
I am using Android Studio 3.0 Beta 2 version and I cannot get the design preview to show. There are no devices available in the dropdown. I have tried adding a new device definition.
This is what it looks like:
This is what I want:
What am I doing wrong?
i think you need to update your sdk with another APIs
Add this line of code in your build.gradle
compile 'com.android.support:design:25.3.1'
Turns out the issue was in the gradle file. Once I updated the build tools version the problem went away.
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'm using Android Studio 0.2.3 and when opened an activity layout normally, the preview should appear on the right side, so that I can switch between Text and Design mode, which should again show the preview of the layout.
But no preview is shown not on the right side neither when I'm in text mode nor in the design mode. I just get the error rendering problems...
When I compile everything and install the app on my device, it works without any errors. For developing and experimenting with the layout, it would still be nice if I could get the preview to work.
I have also tried to switch between different devices in the studio, but no success.
Does anyone know how solve this?
Change your android version on your designer preview into your current version depend on your Manifest. rendering problem caused your designer preview used higher API level than your current android API level.
Adjust with your current API Level. If the API level isn't in the list, you'll need to install it via the SDK Manager.
In new update android studio 2.2 facing rendering issue then follow this steps.
I fixed it - in styles.xml file I changed
"Theme.AppCompat.Light.DarkActionBar"
to
"Base.Theme.AppCompat.Light.DarkActionBar"
It's some kind of hack I came across a long time ago to solve similar rendering problems in previous Android Studio versions.
Open AndroidManifest.xml
Change:android:theme="#style/AppTheme"to something like:android:theme="#style/Theme.AppCompat.Light"
Hit "refresh" button in the "Previev" tab.
I was able to fix this in Android Studio 0.2.0 by changing API from API 18: Android 4.3 to API 17: Android 4.2.2
This is under the Android icon menu in the top right of the design window.
This was a solution from http://www.hankcs.com/program/mobiledev/idea-this-version-of-the-rendering-library-is-more-recent-than-your-version-of-intellij-idea-please-update-intellij-idea.html.This required a Google translation into English since it was in another language.
Hope it helps.
In the Latest Android Studio 3.1.3, Dependency:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
or
Even in latest by 27th of Aug 18 ie
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
facing similar issue
Change it to
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1
This will solve your problem of Preview.
UPDATE
Still, in beta01 there is a preview problem for latest appcompact v7 library
make the above change as changing it to alpha01 for solving rendering problem
When I set that android:autofillHints="" /> in .xml file, I met the issue, Android Studio rendering problems, so I set that android:autofillHints="testHint" />, this issue is gone.
I have solved the Problem by changing style.xml
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
this was an awesom solution.
it still happens in Android Studio 1.5.1. on Ubuntu and you can solve it simply changing a setting from Gradle:
1) on app/build.gradle dependencies change from:
compile 'com.android.support:design:23.2.0'
to:
compile 'com.android.support:design:23.1.0'
2) rebuild project
3) refresh view
Best regards,
/Angel
I had the same problem, current update, but rendering failed because I need to update.
Try changing the update version you are on. The default is Stable, but there are 3 more options, Canary being the newest and potentially least stable. I chose to check for updates from the Dev Channel, which is a little more stable than Canary build. It fixed the problem and seems to work fine.
To change the version, Check for Updates, then click the Updates link on the popup that says you already have the latest version.
In build.gradle below dependencies add:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "27.+"
}
}
}
}
This worked for me, I found it on stack, addressed as the "Theme Error solution":
Theme Error - how to fix?
Rendering didn't work for me too. I had <null> value on the right side of the android icon. I ran
sudo apt-get install gradle
I restarted Android studio then and <null> value changed to 23.
Voila, it renders now! :)
Just download minimum prefered SDK from SDK Manager, then build. Works for me.
Make sure your designer version and targetSdkVersion both is same.
Example : If your targetSdkVersion is 22 then change your designer version also 22, so this problem do not occur.
Best Solution is go to
File -> Sync Project With Gradle Files
I hope this helped
All you had to do is go to styles.xml file and replace your parent theme from
Theme.AppCompat.Light.DarkActionBar
to
Base.Theme.AppCompat.Light.DarkActionBar
Open your activity_main.xml .
Switch to Design view if you are in text view.
Look for the android version,with the android robo icon.
Change the android version.
Problem solved.
this issue is probably derived from the connection of the laptop to software products like AnyConnect. Killing the remote connection works for me.