DrawableWrapper missing from support v4 library - android

I tried replacing a local jar of the android-support-v13 library with a maven dependency like this
compile files('libs/android-support-v13.jar')
replaced with
compile 'com.android.support:support-v13:21.0.0'
However, when I try to compile this import fails
import android.support.v4.graphics.drawable.DrawableWrapper;
Has this class been removed from the support library?

Try:'compile com.android.support:support-v13:24.2.0'
Version 21 of support library is quite old and so may not contain the needed class.

Related

Build library Github with Jitpack include dependencies

I'm building a library with jitpack.io I was able to build and compile into the application successfully, but the problem here is that in the library there includes a number of other libraries compiled into
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.facebook.android:audience-network-sdk:4.99.1'
implementation 'com.appnext.sdk:banners:2.4.2.472'
implementation 'com.appnext.sdk:ads:2.4.2.472'
implementation 'com.appnext.sdk:native-ads2:2.4.2.472'
implementation 'org.jsoup:jsoup:1.11.3'
so when I compiled the library into my application and called it, it reportedly did not find the class I was including into libraries(org.jsoup., com.appnext., ..). If I want to use I have to re-declare the libraries on again in my application. Is there a way to not do this, as includes the library inside
I was facing the same issue and apparently it's a bug in maven gradle plugin v1.5; problem solved after my plugin version is updated to 2.1.
Issue: https://github.com/dcendents/android-maven-gradle-plugin/issues/61
Related Answer: https://stackoverflow.com/a/51190164/1640033

Cannot resolve symbol 'MediaSessionCompat'

I cannot import MediaSessionCompat.
The import statement for importing the whole android.support.v4.media library does not show up in the Android Studio "IntelliSense" and it cannot resolve the symbol for anything inside it.
Do I have to make some kind of extra configuration to get this import, like in app build.gradle?
Add these to your dependencies and sync Gradle:
Pre-AndroidX
implementation 'com.android.support:support-compat:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
Post-AndroidX
implementation 'androidx.core:core:1.8.0'
implementation 'androidx.media:media:1.6.0'
Note from official documentation:
With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.
You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.
We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.
The latest dependencies are:
implementation 'androidx.core:core:1.1.0'
implementation 'androidx.media:media:1.1.0'
def core_version = "1.9.0"
// Java language implementation
implementation "androidx.core:core:$core_version"
// Kotlin
implementation "androidx.core:core-ktx:$core_version"
implementation "androidx.media:media:1.6.0"

Build an .aar with all dependencies

I am building an SDK for Android that should be exported as an .aar file.
The SDK has a list of dependencies defined in its build.gradle file, for example:
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services-ads:9.0.2'
My question is: how do i include these libraries in the .aar, so that it is self-contained and does not require the developer using it to add these libraries when using my SDK?
I have looked everywhere for this, but most answers don't seem to address this issue or don't work.
How do i include these libraries in the .aar
Not at all.
An .aar-file is not intended to contain it's own dependencies
You should use a dependency management system (like maven or ivy) to distribute your SDK in order to handle transitive dependencies.

Use android support v7 library classes in my library

I add android.support.v7.appcompat library in my project but I am not able to use this library class and methods in it. I have done it again and again but same problem exist any one please help me.
try adding this in your app gradle dependencies:
compile 'com.android.support:appcompat-v7:22.2.0'
for the design compile this:
compile 'com.android.support:design:22.2.0'

How to use import Android-PullToRefresh

https://github.com/chrisbanes/Android-PullToRefresh
From this link url
I using android studio and i want to import library to my project, other library has dependencies it's easy to use like
dependencies {
compile 'com.android.xxxxxx
}
But this library has not, How can i import this library to my project Thank you
you don't need that project, get Android support library and try this tutorial:
http://antonioleiva.com/swiperefreshlayout/
You can try this:
compile group: 'com.github.chrisbanes.pulltorefresh', name: 'parent', version: '2.1.1'
found here:
https://mvnrepository.com/artifact/com.github.chrisbanes.pulltorefresh/parent/2.1.1
or use this library derived from this one:
https://github.com/naver/android-pull-to-refresh/wiki/Quick-Start-Guide

Categories

Resources