0
 val cardImage = creditCardModel?.let { cardHelper.getCardImage(it) }
 cardImage?.let { ivCardImage.setImageResource(it) }

ic_salepluscard.xml

<vector android:autoMirrored="false"
android:height="130dp"
android:viewportHeight="130"
android:viewportWidth="288"
android:width="288dp"
xmlns:aapt="http://schemas.android.com/aapt"
xmlns:android="http://schemas.android.com/apk/res/android">
<group>
    <clip-path android:pathData="M0,0h288v130h-288z M 0,0" />
    <group>
        <clip-path android:pathData="M0,0h288v130h-288z M 0,0" />
        <path android:pathData="M0,0H288V130H0Z">
            <aapt:attr name="android:fillColor">
                <gradient
                    android:endX="234.72"
                    android:endY="179.66"
                    android:startX="26.496"
                    android:startY="-15.08"
                    android:type="linear">
                    <item
                        android:color="#FF60707A"
                        android:offset="0" />
                    <item
                        android:color="#FF181F23"
                        android:offset="0.323" />
                    <item
                        android:color="#FF88959D"
                        android:offset="0.678" />
                    <item
                        android:color="#FF181F23"
                        android:offset="1" />
                </gradient>
            </aapt:attr>
        </path></vector>

Logcat errors:

android.content.res.Resources$NotFoundException: File res/drawable/ic_saleplusplatinumkart.xml from drawable resource ID #0x7f020250. If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled

android.content.res.Resources$NotFoundException: File res/drawable/ic_saleplusplatinumkart_1.xml from color state list resource ID #0x7f020373

Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #14: invalid drawable tag gradient

I tried everything but I couldn't find a solution.Can you help me how can I solve this problem?

1
  • What do you mean by androidx solved? Atleast explain how you solved it. Commented Apr 7, 2021 at 17:51

1 Answer 1

0

try this:

 val drawable: Drawable = AppCompatDrawableManager.get().getDrawable(this, R.drawable.radius_stroke_cat)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.