<ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/appLogoView" android:focusableInTouchMode="false" android:src="@drawable/app_logo" android:layout_alignParentBottom="false" android:layout_centerInParent="true" android:layout_alignParentTop="false" android:layout_alignParentLeft="false" android:layout_alignWithParentIfMissing="false" /> 

The app_logo.svg file in drawable is placed, but the image is not displayed in the application and Android Studio does not highlight the android line : src = "@ drawable / app_logo" in red.

What is the problem?

  • SVG format is not supported by Android / Before use, you need to convert to VectorDrawable format. Android Studio has a tool for this - Vector Asset Studio - pavlofff

1 answer 1

The svg and psd files need to be added to Vector Asset Studio, which converts them to an xml file. In Android Studio, right-click on the "res" folder, and there choose: "New> Vector Asset". Next, select the "Local file". Then just specify the name, click the next. Details here: https://developer.android.com/studio/write/vector-asset-studio#importing