Basically I have Android app which uses 23.1.1 of the support library(com.android.support:appcompat-v7:) while Im using a library which uses 25.0.0 version. Basically if I update the version and make it to be equal(the project one and the library one) Im getting a lot of null pointer exceptions which is pretty strange because the app works pretty well at the current version(23.1.1). If I force the library to be using the version of the app - there is a compile error because a new things have been added with the new version(25.0.0). Is it possible somehow to say in the build.gradle let`s the app be using the 23.1.1 version of com.android.support:appcompat-v7: and the library to use its(25.0.0) version of com.android.support:appcompat-v7:?
Is it possible somehow to say in the build.gradle let`s the app be using the 23.1.1 version of com.android.support:appcompat-v7: and the library to use its(25.0.0) version of com.android.support:appcompat-v7:?
No, because there is only copy of appcompat-v7 in your app.
Can you try to remove your import of the 23.x.x of the support library .
The version of the support library that is present in your lib will be use .
Related
I am use the latest version for individual dependencies.
Versions are referenced from here and here
But I am still getting warning message of conflict versions.
Not sure if it is safe to use like this.
Images attached below.
you can update same version all play services dependencies and solve the issues
Also try to remove your custom libraries from project and sync project. Old versrions of libraries can be used by them.
I tried to set the AppCompat version to '25.0.2' and Design version to '25.+'
This was showing as an error under AppCompat, with RunTime crashes as message.
Please let me know if it is possible to have different SDK values.
You should always use the same version for your support libraries.
You can use a different version of support library, but you should not!. Because, as the error says, it will lead to a runtime crash. Why? Because when you using design version to '25.+' it means that you want to use the most recent of version 25 which is 25.3.1. But you use appcompat 25.0.2. It will introduce some bugs because support design is depend on appcompat implicitly. So, when you add the support design dependency, the appcompat will be implicitly included in your dependency.
You can verify that by looking at gradle dependency tree with:
./gradlew app:dependencies
When you using a different support library version for design and appcompat, there is a probability that the design library need an api that is not in the previous appcompat version yet. So, it will lead to a runtime crash.
My compiledsdkversion is 23. My Android support library has a 24.0.0-alpha1designation at the end of the string which declares it on my gradle app file. Gradle is compiling with errors stating that the support library should not use a different version than the compiledsdkversion.Any ideas on how to get rid of this error. I don't know how to update the compiledsdkversion.
You should use the latest stable version of the Support Library, which is currently 23.2.1 as per the release notes.
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
The project I am working on uses the appboy library. Unfortunately this lib depends on the v4 support library and uses this depreciated method. I want to update the support library to version 21.0.0 but I get the following error message.
java.lang.NoSuchMethodError: android.support.v4.widget.SwipeRefreshLayout.setColorScheme
How can I configure gradle so the appboy library uses an older support lib(preferable 20.0.0) but the project uses 21.0.0?
I import appboy like so
compile 'com.appboy:android-sdk-ui:1.5.3'
Appboy has updated the Android SDK to use version 21 of the support library; this issue is resolved in the most current release.
Its because you are trying to use support library v21.0.0 with older version of android.
Just include the new AppCompat v21.0.0 and change the compilation version of your project into android 5.0