I used support design library in my project,but there is a error that it is not found.My android Studio has updated Android Support Library 22.2
compile 'com.android.support:design:22.2.0'
this is my first time use of support design library.can somebody help me?
Jared Burrows is right, need update SDK ( support library )
You need to update the android support Repository in the SDK manager .
Also the Design Library depends on the Support v4 and AppCompat Support Libraries.
Reference:
http://android-developers.blogspot.in/2015/05/android-design-support-library.html
I also suffered from this error, the solution was to open the android sdk and from extras install android support repository.
but on the most recent version android support repository does not exist you have to install local maven repository support library. i hope this will help you.
Related
When the implementation 'com.karumi:dexter:6.0.0' is added in build.gradle file, Error is shown on line number 24 while implementing appcompat:implementation 'com.android.support:appcompat-v7:26.1.0'
its the build.gradle(Module:app)
Error in Gradle
From your gradle error message, it is seen that your are using the andorid earlier project structure library.
You are trying to implement implementation 'com.karumi:dexter:6.0.0' library which is using the androidx support library structure.
Hence, your are getting that error as you cannot use both the structure as they have been made and organized complete differently.
Solution:
Shift to androidx library structure if you really want to use that library.
Refer this official documentation of Google Android to migrate to andoirdx from android -
Google Developers Documentation
The library you are trying to use is using AndroidX libraries and you are using Andeoid support libraries in your project. Either migrate your project to androidx or ise an older version of the library which use android support libraries.
You should migrate your project AppCopact to AndroidX. For migrating project AppCompact to Androidx Go Refactor -> Migrate to Androidx then tick on BackUp Project and Migrate. After Migration The com.karumi:dexter:6.0.0 library will work perfectly.
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 .
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
When I write code in Android Studio with some features from android support library it is ok, but when I try to build application, it cannot recognize some methods from support library. In "External library" I see that there is android-support-library revision 7, but in gradle file I wrote
compile 'com.android.support:support-v4:20.+'
I can't figure out what's the problem? and how can i solve it, could you please help me?
Just don't use the + sign:
compile 'com.android.support:support-v4:20.0.0'
So you can choose any fixed version number.
However the newest version was on Friday 21.0.2. I didn't check it in the meantime.
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