0

I have imported an icon from Google Fonts site into my Android project. I saved the svg file to a new assets folder. I then used it to create a vector resource. I then call it in my program like so:

                    Icon(
                        painter = painterResource(id = R.drawable.groups_fill0_wght0_grad0_opsznan__1_),
                        contentDescription = "Exit",
                        tint = MaterialTheme.colorScheme.onSurfaceVariant,
                        modifier = Modifier.size(32.dp)
                    )

When I run the code I get the following error when I am not able to resolve and rectify. Please help.

Can not extract resource from com.android.aaptcompiler.ParsedResource@359b3386.

There is no other information.

Here is the svg file I downloaed:

<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48">
    1<path d="M0 816v-53q0-38.567 41.5-62.784Q83 676 150.376 676q12.165 0 23.395.5Q185 677 196 678.652q-8 17.348-12 35.165T180 751v65H0Zm240 0v-65q0-32 17.5-58.5T307 646q32-20 76.5-30t96.5-10q53 0 97.5 10t76.5 30q32 20 49 46.5t17 58.5v65H240Zm540 0v-65q0-19.861-3.5-37.431Q773 696 765 678.727q11-1.727 22.171-2.227 11.172-.5 22.829-.5 67.5 0 108.75 23.768T960 763v53H780Zm-480-60h360v-6q0-37-50.5-60.5T480 666q-79 0-129.5 23.5T300 751v5ZM149.567 646Q121 646 100.5 625.438 80 604.875 80 576q0-29 20.562-49.5Q121.125 506 150 506q29 0 49.5 20.5t20.5 49.933Q220 605 199.5 625.5T149.567 646Zm660 0Q781 646 760.5 625.438 740 604.875 740 576q0-29 20.562-49.5Q781.125 506 810 506q29 0 49.5 20.5t20.5 49.933Q880 605 859.5 625.5T809.567 646ZM480 576q-50 0-85-35t-35-85q0-51 35-85.5t85-34.5q51 0 85.5 34.5T600 456q0 50-34.5 85T480 576Zm.351-60Q506 516 523 498.649t17-43Q540 430 522.851 413t-42.5-17Q455 396 437.5 413.149t-17.5 42.5Q420 481 437.351 498.5t43 17.5ZM480 756Zm0-300Z"/></svg>

and here is the vector file that was created:

<vector android:height="32dp" android:viewportHeight="960"
    android:viewportWidth="960" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#FF000000" android:pathData="M0,720v-53q0,-38.57 41.5,-62.78Q83,580 150.38,580q12.16,0 23.4,0.5Q185,581 196,582.65q-8,17.35 -12,35.17T180,655v65L0,720ZM240,720v-65q0,-32 17.5,-58.5T307,550q32,-20 76.5,-30t96.5,-10q53,0 97.5,10t76.5,30q32,20 49,46.5t17,58.5v65L240,720ZM780,720v-65q0,-19.86 -3.5,-37.43Q773,600 765,582.73q11,-1.73 22.17,-2.23 11.17,-0.5 22.83,-0.5 67.5,0 108.75,23.77T960,667v53L780,720ZM300,660h360v-6q0,-37 -50.5,-60.5T480,570q-79,0 -129.5,23.5T300,655v5ZM149.57,550Q121,550 100.5,529.44 80,508.88 80,480q0,-29 20.56,-49.5Q121.13,410 150,410q29,0 49.5,20.5t20.5,49.93Q220,509 199.5,529.5T149.57,550ZM809.57,550Q781,550 760.5,529.44 740,508.88 740,480q0,-29 20.56,-49.5Q781.13,410 810,410q29,0 49.5,20.5t20.5,49.93Q880,509 859.5,529.5T809.57,550ZM480,480q-50,0 -85,-35t-35,-85q0,-51 35,-85.5t85,-34.5q51,0 85.5,34.5T600,360q0,50 -34.5,85T480,480ZM480.35,420Q506,420 523,402.65t17,-43Q540,334 522.85,317t-42.5,-17Q455,300 437.5,317.15t-17.5,42.5Q420,385 437.35,402.5t43,17.5ZM480,660ZM480,360Z"/>
</vector>
Nazir
  • 155
  • 1
  • 2
  • 7

0 Answers0