I want to use a GraphView in my app, and so I added implementation 'com.jjoe64:graphview:4.2.2' to my app-level gradle.build file.
However that causes an error stating that all com.android.support libraries should have the same version.
It gives com.android.support:support-compat:27.1.1 as an example (all of the libraries I explicitly use are 26.1.0).
I suppose it's a dependency of the GraphView library, but I don't know what to do next.
My target SDK version is 26 so I can't change all the other versions to 27. What can I do to use this library?
Follow below step:
1>If compileSdkVersion is 27 You have to change to 27
enter image description here
2>If you still caught error uninstall and install SDK Target version from SDK Manager.
Related
I am getting some issue while updating compilesdk and targetsdk to 33.
And if I set compilesdk or targetsdk to 32, 31 or less, I get another library support issue during compilation, as described below...
1. Dependency 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.0-alpha02' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Also, the maximum recommended compile SDK version for Android Gradle
plugin 7.2.1 is 32.
Recommended action: Update this project's version of the Android Gradle
plugin to one that supports 33, then update this project to use
compileSdkVerion of at least 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
and getting this same issue with all newly added library to the gradle
I'm not sure if this is a sdk 33 or library issue.
I already tried this--->https://stackoverflow.com/questions/30684613/android-studio-xml-editor-autocomplete-not-working-with-support-libraries/54007742#54007742
Please Refer this link. There is issue in Android Studio Chipmunk Version. Google Team fixed in Android Studio Dolphin. Check Issue Tracker as well
Replace
def lifecycle_version = "2.6.0-alpha02"
with
def lifecycle_version = "2.4.0-rc01"
in build.gradle(app) file.
Please refer to this link for screenshot.
In Android Studio 3, I'm seeing this issue:
The specified Android SDK Build Tools version (26.0.0) is ignored, as
it is below the minimum supported version (26.0.2) for Android Gradle
Plugin 3.0.0.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.0'" from
your build.gradle file, as each version of the Android Gradle Plugin
now has a default version of the build tools.
The problem is that because these are third-party/vendor modules that have buildToolsVersion '26.0.0', I can't modify their build.gradle without forking each submodule.
Is there a way to set a global buildToolsVersion that will override all the sub build.gradles?
Here if you are referring to my previous answers Here is an Update.
1. Compile would be removed from the dependencies after 2018.
a new version build Gradle is available.
Use the above-noted stuff it will help you to resolve the errors. It is needed for the developers who are working after March 2018. Also, maven update might be needed. All above answers will not work on the Android Studio 3.1. Hence Above code block is needed to be changed if you are using 3.1. See also I replaced compile by implementation.
Open app/build.gradle file
Change buildToolsVersion to buildToolsVersion "26.0.2"
change compile 'com.android.support:appcompat to compile 'com.android.support:appcompat-v7:26.0.2'
Solution to this problem is simple
Go to build.gradle (module.app) file
It will help us to rebuild gradle for the project, to make it sync again.
Update to Android Studio 3.0.1 which treats these as warnings.
Android 3.0 was treating such warnings as errors and hence causing the gradle sync operation to fail.
Set the buildToolsVersion '26.0.2' then change classpath 'com.android.tools.build:gradle:3.0.1'.
Make sure you set compileSdkVersion to 26 whiles targetSdkVersion is also set 26.
It is also appropriate to sent set compile 'com.android.support:appcompat-v7:26.0.2'.
just clean and make project / rebuilt fixed my issue give a try :-)
invalidate cache in android studio will resolve this issue. Go to file-> click on invalidate cache/restart option.
Many times as API's are updated. We forgot to update SDK Managers. For accessing recent API's one should always have highest API Level updated if possible should also have other regularly used lower level APIs to accommodate backward compatibility.
Go to build.gradle (module.app) file
change compileSdkVersion
buildToolsVersion
targetSdkVersion, all should have the highest level of API.
I'm using a compatibility library for material card view and the dependency line is giving me error saying that : This support library should not use a different version (21) than the compileSdkVersion(22). The support library is com.android.support:cardview-v7:21.0.0
You are compiling with the SDK version 22 but the CardView dependency specifies SDK version 21.
You have two options:
1. Change CompileSdkVersion in build.gradle to 21
2. Change library version to com.android.support:cardview-v7:22.0.0
I'm targeting Android 19 (because that's what my phone is running). I want to add a notification with buttons; it seems the right approach is to use appcompat-v7.app.NotificationCompat.
However, when I add appcompat-v7 from the Android Support repository revision 22.2 (via a build.gradle dependency), it includes a file app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-v21/values-v21.xml that doesn't compile because it assumes the target is 21+.
I tried deleting that file, but it gets regenerated.
There doesn't seem to be a way to exclude a file from the build.
So, I need to get an older version of the support library or repository, that doesn't include 21 stuff.
I guess I could import all the sources directly (and leave out the v21 stuff), rather than thru the dependency? I'm not clear where to start with that.
I can use the SDK manager to get older versions of the SDK, but it only offers the latest version of the support library.
to directly answer your question it's all that one line on gradle:
compile 'com.android.support:appcompat-v7:22.2.0'
That last part is the version you're getting. 22.2.0 on the example above.
and on this link you can check the revisions numbers:
https://developer.android.com/tools/support-library/index.html#revisions
But you have a fundamentally wrong approach to your issue. You don't have to target the API for the device you have with you. You can easily and safely target the latest API, use the latest AppCompat features and bug fixes.
Lint will give you a warning every time you try to use a feature that is not from your minimumApi, regardless of the targetAPI
In your gradle build file change the dependency to be the 19 version (the version of the library should match the sdk you are compiling with):
dependencies {
compile 'com.android.support:appcompat-v7:19.1.+'
...
}
Edit: If v19 of the support lib doesn't have NotificationCompat, then you can't use that unless you compile against a later SDK. You can't include a support library with a higher version than your compiled SDK - that's the issue you are running into.
In this case change:
android {
compileSdkVersion 22
...
}
and leave the dependency set to the 22 version of the appcompat support lib
I'm following the Google I/O conference and just a week before they announced that Android Studio 0.8 is available for downloading. Before that I used 0.6 and I was developing an application. Now I'm having both 0.6 and 0.8 on my Ubuntu. I added all the update from SDK for Android Watch and TV and all the Material Design stuffs. And today when I opened my project in the 0.8 version, after a few updates of some things, I'm receiving an error
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1
If someone has any idea what is this all about - share please. I tried to pull my project from my repository in GitHub, but without any result. Thank you.
It looks like you have declared a dependency on version 21 of appcompat-v7 in your build.gradle.
At this time, the preview of the Android L support libraries only works with apps that declare the L preview as their min SDK.
Either revert to a previous version of the support library (I believe the latest is com.android.support:appcompat-v7:19.1.0) or update your project to support a minimum of 'L'.
just try this:
android {
android {
compileSdkVersion 20 //or whatever you want
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 14 //or whatever you want
targetSdkVersion 20 //or whatever you want
}
}
dependencies {
compile 'com.android.support:appcompat-v7:19.+'
}
}
and if you have another module in your project, check manifest files in those modules too.
I had a similar issue like that before. After I updated to 0.8.1, it showed an error below when compiling my previous projects.
"uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1".
This is how I fixed it.
In your project, find build.gradle file in app folder and open it.
At dependencies section, change the value of compile 'com.android.support:appcompat-v7'. For example, in my case, it was compile 'com.android.support:appcompat-v7:+', and I changed it to compile 'com.android.support:appcompat-v7:20.+'. Of course, you could change it to compile 'com.android.support:appcompat-v7:19.+' if you like.
I hope it would help. Let me know if you are still stuck on it.
I had similar problems. Although I'm not sure exactly what caused the problem or which step fixed the issue, I did the following and ultimately got things working again:
I closed down Android Studio
I ran SDK Manager and and checked that everything was up to date. I have the following installed:
Android SDK tools Rev. 23
Android SDK Platform-tools Rev. 20
Android SDK Build-tools Rev. 20
Android L (API 20, L preview)
Android 4.4W (API 20)
Android 4.4.2 (API 19)
I restarted Android Studio and started a new (blank) project to test and ran it -> Success!
I found the process pretty finickity, so your mileage might vary. Let me know how you go.
I had the same error. I found the solution.
dependencies {
compile ('com.android.support:support-v13:20.0.0'){
force = true
}
compile ('com.android.support:support-v4:20.0.0'){
force = true
}
compile ('com.android.support:appcompat-v7:20.0.0'){
force = true
}
}
I think that instead of 20.0.0, you can specify a different version if you use less than 20 targetSdkVersion.
I had the same issue.
I made the following changes to the dependencies section in build.grade file located in the app folder.
'com.android.support:appcompat-v7:20.0.0' to 'com.android.support:appcompat-v7:20.+'